Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Macro for Month Name.
Written by Allen Wyatt (last updated September 19, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003
Brian is looking for a macro that returns the full name of the current month, such as July, August, etc. Before getting to the macros, it should be mentioned that depending on your needs, you can get the desired information with one of several formulas. Perhaps the easiest formula is the following:
=Today()
Place the formula into a cell, and you end up with today's date. Format the cell using a custom format, and you end up with the full month name. The custom format is applied by using these steps:
Figure 1. The Number tab of the Format Cells dialog box.
Another formulaic approach is to use the following in a cell:
=Text(Today(),"mmmm")
No special formatting is required; the formula returns the text of the full month name for whatever today is. Finally, you could use an even longer formula that simply picks the month name from a list of months:
=CHOOSE(MONTH(NOW()),"January","February", "March","April","May","June","July", "August","September","October","November", "December")
Remember that this is a single formula; it goes all in one cell.
Which brings us, finally, to the macros. If you want a macro that returns the month name in the current cell, you are looking for a user-defined function:
Function MonthName() Application.Volatile MonthName = Format(Date, "mmmm") End Function
This simple two-line macro dynamically returns the month name for whatever the current date is. Just put this formula in a cell:
=MonthName()
Remember—since you've just added a macro to your workbook, you'll be asked whenever you open your workbook if you want to enable macros. If you don't want to see this question all the time, you should use one of the formulaic approaches presented earlier.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2915) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Macro for Month Name.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
Need to figure out when a fiscal year ends when that period does not correspond to the calendar year? Here are some ways ...
Discover MoreExcel stores dates and times internally using what is called a serial number. This tip explains how that serial number is ...
Discover MoreWant to figure out the day of the month represented by a particular date? You can use the Day function in VBA to get the ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2020-09-19 11:43:16
Rick Rothstein
For those who might find this interesting, there is a simple way to get the Month name from the month number in both VBA and via Excel formula.
In VBA this is dirt simple as there is a function for it... MonthName (figures, right?). Simply pass the number in and the function returns the full name. There is an optional Boolean argument that when set to True returns the abbreviated month name instead.
Now for the Excel formula (cell A1 is assumed to contain a number between 1 and 12)...
=TEXT(28*A1,"mmmm")
You can also use 29 in place of the 28 and it will still work. Both of those numbers will work correctly in the 1904 date system as well. If you never work in the 1904 date system, you can also use 30 in place of the 28 and that will also work.
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments