Home Privacy Policy Feedback Link to us Site Map Forums

Excel: MonthName Function (VBA only)


In Excel, the MonthName function returns a string representing the month given a number from 1 to 12.

The syntax for the MonthName function is:

MonthName( number, [ abbreviate ] )

number is a value from 1 to 12, representing the month.

abbreviate is optional. This parameter accepts a boolean value, either TRUE or FALSE. If this parameter is set to TRUE, it means that the month name is abbreviated. If this parameter is set to FALSE, the month name is not abbreviated.


Applies To:

  • Excel 2007, Excel 2003, Excel XP, Excel 2000

For example:

MonthName(3) would return 'March'
MonthName(3, TRUE) would return 'Mar'
MonthName(7, FALSE) would return 'July'

VBA Code

The MonthName function can only be used in VBA code. For example:

Dim LValue As String

LValue = MonthName(3, TRUE)

In this example, the variable called LValue would now contain the value of 'Mar'.