Making All Ordinal Suffixes Superscript

Written by Allen Wyatt (last updated July 18, 2026)

Joshua needs to make all ordinal suffixes (st, nd, and rd) superscript. He has a macro that will do it in regular text, but if the ordinal suffixes are in tables, footnotes, or endnotes, they are ignored. Joshua wonders how he can make ordinal suffixes superscript regardless of where they appear in a document.

As you are typing a document, Word automatically makes ordinal suffixes into superscript. It is very possible, however, that Joshua is working with documents from others where the suffixes are not superscript, and it is these that he needs to change.

The key is to understand that Word documents consist of different "layers," for lack of a better term. The document elements that Joshua mentions, such as footnotes and endnotes, are on different layers. In VBA, these layers are called "stories," and if you want to affect the text within those stories, you need to step through them in your macro.

Something that Joshua mentioned should be pointed out here before looking at macros. He stated that ordinal suffixes that are in tables were not modified by his macro. If the table is within the main document text, then the macro should have worked on it. The only time it wouldn't is if the table is contained in a different story. For instance, if the table is in the endnotes, then it would be part of the endnote story. The fact it didn't work for Joshua would indicate that the table is, indeed, in a different story.

I have not seen Joshua's macro, but let's assume it is something similar to this:

Sub SuperscriptOrdinals()
    Dim findList As Variant
    Dim suffix As Variant
    Dim rngSearch As Range
    Dim rngSuffix As Range

    findList = Array("st", "nd", "rd", "th")

    For Each suffix In findList
        Set rngSearch = ActiveDocument.Content

        With rngSearch.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "[0-9]@" & suffix
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchCase = False
            .MatchWildcards = True

            Do While .Execute
                Set rngSuffix = rngSearch.Duplicate

                'Limit the range to the final two characters
                rngSuffix.MoveStart Unit:=wdCharacter, _
                  Count:=rngSuffix.Characters.Count - 2

                rngSuffix.Font.Superscript = True

                'Continue searching after the ordinal just processed
                rngSearch.Collapse Direction:=wdCollapseEnd
                rngSearch.End = ActiveDocument.Content.End
            Loop
        End With
    Next suffix
End Sub

The macro searches through the document and finds any number followed by one of the four ordinal suffixes. It then makes those suffixes superscript. The macro only checks the text in the main portion of the document, specified by the ActiveDocument.Content range. If you want to check the other stories, then you would need to modify the macro, similar to this:

Sub SuperscriptOrdinalsEverywhere()
    Dim findList As Variant
    Dim suffix As Variant
    Dim firstStory As Range
    Dim currentStory As Range
    Dim rngSearch As Range
    Dim rngSuffix As Range
    Dim storyEnd As Long

    findList = Array("st", "nd", "rd", "th")

    For Each firstStory In ActiveDocument.StoryRanges
        Set currentStory = firstStory

        Do While Not currentStory Is Nothing
            storyEnd = currentStory.End

            For Each suffix In findList
                Set rngSearch = currentStory.Duplicate

                With rngSearch.Find
                    .ClearFormatting
                    .Replacement.ClearFormatting
                    .Text = "[0-9]@" & suffix
                    .Forward = True
                    .Wrap = wdFindStop
                    .Format = False
                    .MatchCase = False
                    .MatchWholeWord = False
                    .MatchWildcards = True

                    Do While .Execute
                        Set rngSuffix = rngSearch.Duplicate

                        'Limit the range to the final two characters.
                        rngSuffix.MoveStart Unit:=wdCharacter, _
                          Count:=rngSuffix.Characters.Count - 2

                        rngSuffix.Font.Superscript = True

                        'Continue searching after the ordinal just processed.
                        rngSearch.Collapse Direction:=wdCollapseEnd
                        rngSearch.End = storyEnd
                    Loop
                End With
            Next suffix

            Set currentStory = currentStory.NextStoryRange
        Loop
    Next firstStory
End Sub

Notice that the primary difference is that the macro steps through each story in the document and repeats the Find-and-Replace processing in each one, provided the story has content. This allows the macro to process not just the main document, but also footnotes, endnotes, headers, footers, comments, and other available stories.

Note, as well, that the macros in this tip assume that the ordinal suffixes used in the document are correct. If you want a macro to check for the appropriateness of a suffix (for instance, "llth" instead of "llst"), then the macro would be a good deal longer.

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 (13986) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.

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

Sudden Increases in Workbook File Size

Workbooks can get rather large rather quickly. If you think your workbook has gotten too big too fast, here are some ...

Discover More

Rotate a Graphic Using the Keyboard

Rotating a graphic using the mouse is rather easy. Rotating a graphic using the keyboard is a bit trickier. This tip ...

Discover More

Pulling First Letters from Parenthetical Text

When working with text in Excel, you can slice and dice it in many ways. This tip shows how to pull first letters from ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More WordTips (ribbon)

Intelligent Title Case

A common editorial need is to change the capitalization used on different words in a selection of text. Word provides a ...

Discover More

Cleaning Up a Document that Mixes Styles with Direct Formatting

Need to get rid of direct, explicit formatting applied to a document? Here's an easy way to do it using familiar Word tools.

Discover More

Precise Ruler Adjustments

When adjusting the position of things on the Ruler (like tab stops), you can use the Alt key to get very precise in your ...

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 seven more than 1?

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 ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu 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.