Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Changing the Format of Existing Dates.

Changing the Format of Existing Dates

Written by Allen Wyatt (last updated December 12, 2020)
This tip applies to Word 97, 2000, 2002, and 2003


Aileen works with a lot of documents that have the date in a numeric format, such as 9/22/12. She needs to convert these dates to a different format, specifically September 22, 2012. She wonders if there is an easy way to make the change without needing to retype each date.

The answer depends, in large part, on the nature of the date you are changing. Dates in a Word document can either be straight text or a field. You can tell if the date is a field by simply moving the insertion point somewhere inside the date. If it is a field, then the entire date should be shaded in light gray once the insertion point is within the date.

If the date is a field, then you can right-click on the date and choose Edit Field from the resulting Context menu. You can then modify the field, including selecting a different date format in the Field Properties list.

If the date is regular text (not a field), then you need to look to a different solution. It is possible to go through the document and manually retype all the dates, but Aileen already found out that such an approach is tedious. This is where a macro can come in handy: to cure the tedium by programmatically doing what you would otherwise do by hand.

The following macro will step through a document, searching for all dates in the format m/d/yyyy. (There can be either one or two digits for either the month or day, but must be four digits for the year.) If a date matching this pattern is found, it is converted to the format mmmm d, yyyy.

Sub GetDateAndReplace()
    Dim FoundOne As Boolean

    Selection.HomeKey Unit:=wdStory, Extend:=wdMove
    FoundOne = True ' loop at least once

    Do While FoundOne ' loop until no date is found
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "([0-9]{1,2})[/]([0-9]{1,2})[/]([0-9]{4})"
            .Format = True
            .Forward = True
            .MatchWildcards = True
        End With

        Selection.Find.Execute Replace:=wdReplaceNone

        ' check the find to be sure it's a date
        If IsDate(Selection.Text) Then
            Selection.Text = Format(Selection.Text, "mmmm d, yyyy")
            Selection.Collapse wdCollapseEnd
        Else ' not a date - end loop
            FoundOne = False
        End If
    Loop
End Sub

Note:

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

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (3400) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Changing the Format of Existing Dates.

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

Setting Spacing for Radicals in the Equation Editor

The Equation Editor is a great tool for working with mathematical formulas. If your formula includes a radical symbol, ...

Discover More

Adjusting Values with Formulas

Paste Special is a great tool that allows you to modify the values in a range of cells in your worksheets. You may want, ...

Discover More

Dealing with Long Formulas

If your worksheet formulas seem to go on forever, here's a handy way to make them more understandable. (All you need to ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Different Ways of Inserting Dates

Word provides a couple of different ways you can insert the current date into a document. Which method should you choose? ...

Discover More

Determining the Week of the Year

If you are working with dates in a macro, you may need to determine which week of the year a date falls within. This can ...

Discover More

Forcing the Date to the Next Wednesday

Working with today's date in Word is easy. Trying to manipulate dates to come up with a future one can be an entirely ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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 6 - 0?

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 Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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.