VBA MonthName function

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

MonthName Function Description

The VBA MonthName function returns the name of the month represented by the provided Integer number (between 1 to 12).

Syntax

The syntax for the MonthName function in VBA is:

MonthName( number, [ abbreviate ] )

Parameters

number
The number of the month (value between 1-12).

abbreviate
Optional. A boolean value stating if the name of the month should be abbreviated (usually 3 letter abbreviation). For FALSE the name of the month will be NOT abbreviated, for TRUE the name of the month WILL be abbreviated.

Example usage

The MonthName function can be used in VBA code. Let’s look at some VBA MonthName function examples:

MonthName 3
Result: March

MonthName 12, TRUE
Result: Dec

MonthName 6, FALSE
Result: June

Simply the best place to learn Excel VBA