MONTHNAME

MONTHNAME(month [,abbreviate])

Returns the month as a string (String).


monthThe number of the month (Integer):
1 = Jan
2 = Feb
3 = Mar
4 = Apr
5 = May
6 = Jun
7 = Jul
8 = Aug
9 = Sep
10 = Oct
11 = Nov
12 = Dec
abbreviate(Optional) Whether the month name is abbrevated (Boolean):
False = the month name is not abbreviated (default)
True = the month name is abbreviated

REMARKS
* If "abbreviate" = True, then the month name will be abbreviated to three characters.
* If "abbreviate" = False, then the month name is not abbreviated.
* If "abbreviate" is left blank, then False is used.
* You can use the WEEKDAYNAME function to return the day of the week as a string.
* This function was added in VB 6.0.
* The equivalent .NET function is Microsoft.VisualBasic.DateAndTime.MonthName
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print MonthName(2)           '= February  
Debug.Print MonthName(12) '= December
Debug.Print MonthName(12, False) '= December
Debug.Print MonthName(12, True) '= Dec
Debug.Print MonthName(2, True) '= Feb

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top