MonthName Function
Returns a string indicating the specified month.
Syntax
MonthName(month[,abbreviate])
Arguments:
- Month: Required. The numeric designation of the month. For example, January 1, February 2, and so on.
- Abbreviate: Optional. Boolean value that indicates if the month name is to be abbreviated. If omitted, the default is False, which means that the month name is not abbreviated.
Remarks
The following example uses the MonthName
function to return an
abbreviated month name for a date expression:
Example 1:
Dim MyVar
MyVar = MonthName(10)
'Output: October
Example 2:
Dim MyVar1
MyVar1 = MonthName(10, True)
'Output: Oct
Example 3:
Dim MonthNumber2, MyVar2
MonthNumber2 = 5
MyVar2 = MonthName(MonthNumber2)
'Output: May
Example 4:
Dim Month1, Month2, Month3
Month1 = MonthName(1)
Month2 = MonthName(2, True)
Month3 = MonthName(12)
Output: January
Output: Feb
'Output: December