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: Finding a Cell Reference.

Finding a Cell Reference

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


6

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 (ZZ) as it is to return the 64th column (BL). (Word is limited to only 64 columns in a table.)

If you are still using Word 97, then you should know that there is a different approach you can take. Microsoft was kind enough to include a macro that you can use, if desired. This macro is called TableCellHelper, and it is in the Macros8.dot template provided on your original Word 97 (or Office 97) CD-ROM. It may even be installed on your system already; you can use the Find feature of Windows to locate the file and then use Word's Organizer to transfer TableCellHelper to your Normal.dot template.

When you run TableCellHelper, it installs itself on the standard toolbar. When you position the insertion pointer in a table cell and then run the macro, it displays a message box that shows the cell reference of the current cell, along with the overall size of the table.

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 (1358) 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: 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

Opening Multiple Documents at Once

Word's Open dialog box provides many of the same file management functions as Windows Explorer does. One of the functions ...

Discover More

Turning Off Automatic Bulleted Lists

As you are typing away on a document, you may notice that Word automatically formats bulleted lists (or what it thinks ...

Discover More

Counting Lists

Word makes it easy to add both numbered lists and bulleted lists to your document. If you are working with longer ...

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)

Distributing Table Rows Evenly

If you've adjusted the height of your table and the rows within the table, you might want to later return all those rows ...

Discover More

Validating Data

When users add information to a Word document, you may want that information to somehow be validated—to make sure ...

Discover More

Hiding Table Gridlines, by Default

The edges to table cells are shown two ways in Word: gridlines and borders. Table gridlines are only seen in Word; they ...

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 + 5?

2019-07-08 03:24:12

Shahram

Wonderful.. Thanks !


2019-04-18 00:01:58

Linda

Thanks for these tips - found the Table Properties idea very useful.
Any idea on how to reference the page number in a table calculation?
I'm using:

{ FORMTEXT { =SUM(T_P1 D7, T_P1 D12, T_P1 D16, T_P1 D18, T_P1 D21, T_P1 D25, T_P1 C29, T_P2 D5, T_P2 D10,T_P2 D15, T_P2 D19, T_P2 D22, T_P2 D25) } }

I'm not really sure what the T and P stand for in the calculation - I've taken this code from an existing document. The figures appear on page 14 and 15 of the doc, though I'm guessing the calculation is reading TABLE on PAGE 1 in CELL D12 etc.

Any help would be greatly appreciated.


2018-09-28 09:26:11

Katherine

Another way that is easiest for me is to go into table properties. If you have the cell selected that you need the reference for, you can click the column tab and get the column number which will be your letter (1=A, 2=B, 3=C) and then click the Row tab to see what row # you are in. For example the cell I needed a reference for showed in table properties as row 120, column 3. In my formula I referenced it as C120. Worked like a charm.


2016-10-19 05:21:05

Tony KAN

I CAN ATTEST THAT THIS WORKED IN OFFICE 365'S WORD 2016.


2016-04-03 13:10:01

Trevor

Hello,

Though this is incredibly old I found it useful. thank you.

When making a formula in word I am having trouble referencing the specific col:#/row:# within the formula. I can easily use B1 but there are three values in there and I only want one of them to be part of my formula. Can you direct me to proper syntax to address this? I believe if Word is naming this value I should be able to do this in a formula but its quite specific to search and I have had no luck. Any help is appreciated. Thanks


2014-05-28 15:05:06

Mom

super!


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.