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

Finding a Cell Reference

Written by Allen Wyatt (last updated February 26, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


1

When you are working with tables, you often need to know the reference of a particular cell. For certain functions or fields, Word expects the cell reference to be specified using the Column/Row format that many readers are familiar with in Excel. For instance, A1 is the top-left cell, B1 is one cell to the right, and A2 is one cell below the first cell.

Unfortunately, there is no inherent capability of Word to inform you of the reference of a cell you have selected. You can get around this problem by using a macro. The following example macro will return, in the status bar, the current column and row in which the insertion point is located.

Sub CellRef()
    Const clngAOffset As Long = 64
    ' Word's maximum columns is 64, but this procedure
    ' can cope up to clngMaxCols columns
    Const clngMaxCols As Long = 702
    Dim lngRow As Long, lngCol As Long
    Dim strCol As String

    ' See if in table
    If Selection.Information(wdWithInTable) Then
        ' Get column and row numbers
        lngCol = Selection.Information(wdStartOfRangeColumnNumber)
        lngRow = Selection.Information(wdStartOfRangeRowNumber)
        ' Convert column number to letter
        Select Case lngCol
        Case Is < 27
            ' Single character column reference
            strCol = Chr(clngAOffset + lngCol)
        Case Is > clngMaxCols
            MsgBox "Table is too big"
            Exit Sub
        Case Else
            ' Two-character column reference
            strCol = Chr(clngAOffset + Fix((lngCol - 1) / 26))
            strCol = strCol & Chr(CLng(clngAOffset + 1 _
              + ((lngCol - 1) Mod 26)))
        End Select
        ' Show column, row, and cell reference in status bar
        StatusBar = "Col:" & lngCol & "/Row:" & lngRow _
          & " = Cellref: " & strCol & CStr(lngRow)
    End If
End Sub

When you run the macro, it displays the requested information on the status bar in the following format:

Col:2/Row:1 = B1

You should note that the macro will handle tables that have more dimensions that Word will natively handle. This was not arbitrarily done; programmatically it is just as easy to return the 702nd column of a table (column ZZ) as it is to return the 64th column (column BL).

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 (13093) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Word here: Finding a Cell Reference.

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

Positive and Negative Colors in a Chart

When creating a line cart, the line can show values both positive and negative values. This tip explains how you can use ...

Discover More

Printing a List of Named Ranges

You already know that you can define names that apply to different ranges of cells and other elements such as formulas. ...

Discover More

References to Hyperlinks aren't Hyperlinks

Make a reference to a hyperlink in a formula, and you may be surprised that the reference doesn't return an active ...

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 (ribbon)

Aligning Digits in a Table

Placing information in your table is only half the battle. You also need to figure out the best ways to format that ...

Discover More

Jumping to the Ends of Table Columns

Need a quick shortcut to jump to the top or bottom of a table column? Here's the two shortcuts you are searching for.

Discover More

Hiding Table Rows on a Printout

When you work with tables in your document, you may want to hide some of rows in those tables so that they don't print ...

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?

2023-05-11 19:34:12

John

Brilliantly effective macro, clearly explained! Thanks muchly!


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.