Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Macro for Month Name.

Macro for Month Name

Written by Allen Wyatt (last updated March 25, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


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:

  1. Select the cell containing the formula.
  2. Display the Home tab of the ribbon.
  3. Click the small icon at the lower-right corner of the Number group. Excel displays the Format Cells dialog box.
  4. Make sure the Number tab is displayed.
  5. In the list of format categories, select Custom. (See Figure 1.)
  6. Figure 1. The Number tab of the Format Cells dialog box.

  7. In the Type box, enter mmmm.
  8. Click OK.

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 GetMonth()
    Application.Volatile
    GetMonth = MonthName(Month(Date))
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:

=GetMonth()

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:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12447) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Macro for Month Name.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Locking a Field

When you use fields in your document, you may want them to not change from a particular displayed result. You can lock ...

Discover More

Saving an Envelope for Future Use

It can take a while to get an envelope to appear just the way you need. Why throw your work away when you are done with ...

Discover More

Reversing Names In Place

Do you want a way to reverse names within a cell, making them "last, first" instead of "first last?" Here's a handy macro ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Copying Worksheets in a Macro

Copying worksheets (one or many) is easy to do manually. What is not well known is that it is even easy to make the ...

Discover More

Stopping Fonts from Changing

There are multiple ways that Excel can create a workbook, and the formatting in each creation method can be different. In ...

Discover More

Deleting VBA Code in a Copied Worksheet

VBA makes it easy to copy a worksheet from the current workbook into a brand-new workbook. You may want to delete some ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.