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: Changing Months in a Workbook.

Changing Months in a Workbook

Written by Allen Wyatt (last updated January 11, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


It is not unusual to keep track of monthly information, of one sort or another, in a workbook. You might be tracking expenses, sales, inventory movements, stock prices, or any of a thousand other things. When you start a new month, you may make a copy of the previous month's workbook and then look for a way to make changes to the month name that appears in various places in the newly created copy.

If the month name you want to change is stored as text within various worksheets, you can use Excel's find and replace feature to make the changes. Just follow these steps:

  1. Click on the tab of the first worksheet in which you want to make changes.
  2. Hold down the Shift key as you click on the tab of the last worksheet in which you want to make changes. All of the worksheets you want to change should now be selected.
  3. Press Ctrl+H to display the Replace tab of the Find and Replace dialog box.
  4. In the Find What box, enter the old month's name.
  5. In the Replace With box, enter the new month's name.
  6. Click on Replace All.
  7. Close the Find and Replace dialog box.

If these steps do not change a particular month name as it appears in your workbook, it could be because the month name is not actually text, but a date value formatted to show only the month. In that case, you cannot use Find and Replace; instead you must simply change the date value stored in the cell.

If you want a quick way to change the month names in the worksheet tabs, that is a bit more tricky. Excel's find and replace feature won't find or replace the text in tab names. Normally they need to be done by hand, but if you have many of them, you may want to create a macro that will do the changing for you. The following macro prompts you for the text you are searching for and the text you want to replace it with. Then, it steps through each worksheet tab and makes the changes for you.

Sub TabReplace()
    Dim I As Integer, J As Integer
    Dim sFind As String
    Dim sReplace As String
    Dim sTemp As String

    sFind = InputBox("Text to find?")
    sReplace = InputBox("Replace it with?")

    If (sFind & sReplace) = "" Then Exit Sub

    For I = 1 To Sheets.Count
        sTemp = Sheets(I).Name
        J = InStr(sTemp, sFind)
        While J > 0
            sTemp = Left(sTemp, J - 1) & sReplace _
              & Mid(sTemp, (J + Len(sFind)))
            J = InStr(sTemp, sFind)
        Wend

        If sTemp <> Sheets(I).Name Then
            Sheets(I).Name = sTemp
        End If
    Next I
End Sub

Even though the steps (and macro) presented here can make the job of updating your workbook easier, it may be easier still to simply rethink how you do your workbook. It may be easier to set up a cell to contain the current month's name, and then reference that name in the appropriate cells throughout the workbook. Then, all you need to do is change the month name in a single cell, and it will be changed elsewhere, automatically. In other ExcelTips you even learned how you can dynamically change a tab name based on the contents of a particular cell.

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 (2748) 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: Changing Months in a Workbook.

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

Quickly Displaying the Font Dialog Box

Want to quickly format some text in your document? Select, right-click, and make a selection, and you can get to the ...

Discover More

Changing Strikethrough Lines

Want to change the way a strikethrough line appears? It's not as easy as you think, as you find out in this tip.

Discover More

Finding Missing Spaces before Numbers

If you want to insert a space between letters and digits in your document, you have a couple of tasks to perform. First, ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Using Overtype Mode

Have you ever typed something in Excel, only to have it replace whatever is to the right of the insertion point? That's ...

Discover More

Getting Rid of Everything Except Numbers

Got some numbers and letters mixed up in the same cell? You may need to get rid of those letters so you are left with ...

Discover More

Moving and Copying Cells

At the very heart of editing is the ability to move and copy cells in a worksheet. Understanding the differences between ...

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 - 6?

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 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.

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.