Excel VBA MonthName Function: The MonthName function in VBA returns a string with the month name for the specified month number.

Syntax

Parameter

Month (required) – This parameter represents an integer between 1 and 12, signifying the month.

Abbreviate (optional) – This function represents a Boolean argument specifying whether the returned month name should be abbreviated or not. By default, it is set to False.

It can hold the following values:

True – It returns the abbreviated month name, i.e. “Jan”, “Feb”, etc.

False (default value) – It returns the full month name i.e. “January”, “February”, etc.

Return

This function returns a string with the month name for the specified month number.

Example 1

Output

July

VBA MonthName Function

Example 2

Output

Jul

VBA MonthName Function

Example 3

Output

February

VBA MonthName Function

Pin It on Pinterest

Share This