Results 1 to 8 of 8
  1. #1
    3 Star Lounger rcbjr2's Avatar
    Join Date
    Jan 2001
    Location
    Matthews, NC
    Posts
    279
    Thanks
    6
    Thanked 1 Time in 1 Post

    Table Row/Column Indicators (Word 2000 SR-3)

    This is probably a stupid question, but I can't figure out how to do it: how can I determine what row/column my cursor is in when I'm working in a table? There do not seem to be any row/column headings like there are in a spreadsheet, and nothing seems to show in the status bar at the bottom. This wouldn't be such a problem if the table had the same number of cells in each row/column, but I've done a lot of merging of cells and splitting cells. I need to enter a field formula, but I can't easily determine what cells to reference. I cannot embed an Excel sheet for this doc.

    Thx.

    -Rich Belthoff

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    There is no built-in way to determine the row and column of a cell.

    Perhaps one of the Word gurus has a macro that will display this information <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

  3. #3
    3 Star Lounger rcbjr2's Avatar
    Join Date
    Jan 2001
    Location
    Matthews, NC
    Posts
    279
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    That's what I was afraid of. I just tried guessing where I was, and that didn't work. I hope someone has a macro. I may poke about the VBA editor to see if I can create something in a message box.

    Thx.

    -Rich Belthoff

  4. #4
    3 Star Lounger rcbjr2's Avatar
    Join Date
    Jan 2001
    Location
    Matthews, NC
    Posts
    279
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    This code works (although the Columns have numbers instead of letters, but it's easy enough to convert):

    Sub TestRowCell()
    '
    ' TestRowCell Macro
    ' Macro created 10/15/2003 by A334217
    '
    If Selection.Information(wdWithInTable) = True Then
    MsgBox "Column " & Selection.Cells(1).ColumnIndex & " Row " & Selection.Cells(1).RowIndex
    End If
    End Sub

    Thx.

    -Rich Belthoff

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    Thanks. Here is a slight variation that displays the info in the statusbar, and converts the column number to a letter (there is no provision for more than 26 columns):

    Sub TestRowCell()
    If Selection.Information(wdWithInTable) = True Then
    StatusBar = "Column " & Chr(64 + Selection.Cells(1).ColumnIndex) & _
    ", Row " & Selection.Cells(1).RowIndex
    End If
    End Sub

  6. #6
    3 Star Lounger rcbjr2's Avatar
    Join Date
    Jan 2001
    Location
    Matthews, NC
    Posts
    279
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    Thanks. Would the column as a letter routine work in a Msg box?, or is that only for the status bar??

    Thx.

    -Rich Belthoff

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    The code should work in a message box as well, just replace StatusBar = by MsgBox. I just thought that displaying the cell coordinates in the status bar would be less obtrusive than a message box, that requires a mouse click or an Enter to get rid of.

    Computers store characters as numbers, so called ASCII codes (or ANSI or Unicode codes). The ASCII code for "A" is 65, that for "B" is 66. So the letter for column number n has ASCII code 64 + n. The Chr function returns the character corresponding to an ASCII code. So Chr(64 + Selection.Cells(1).ColumnIndex) returns the letter corresponding to column number Selection.Cells(1).ColumnIndex.

  8. #8
    3 Star Lounger rcbjr2's Avatar
    Join Date
    Jan 2001
    Location
    Matthews, NC
    Posts
    279
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Table Row/Column Indicators (Word 2000 SR-3)

    After using it, I tend to agree that showing it in the status bar is easier to use. I thought CHR had something to do with the conversion, but wasn't sure. Thanks for the code and explanation.

    Thx.

    -Rich Belthoff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •