Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Cell Reference In A table (2000)

    I am new to Word, but thought I would jump right off into the deep end: I am working with an extremely large table, and would like to find out the cell reference (i. e., a1, b2, etc.) where I am currently so I can use some field functions. How can I find this out?
    Thanks,
    Jeff

  2. #2
    Star Lounger
    Join Date
    Mar 2001
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cell Reference In A table (2000)

    If you can see all the columns across and can keep track of what they are, the status bar at the bottom of the Word screen will tell you what row you are in.

    There is most like a way to solve this with VBA that someone will come up with.

    Hope this helps a bit.

    SJ Miller

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Cell Reference In A table (2000)

    If you don't mind translating row numbers to letters in your head, you can use this macro:
    <pre>Sub CellAddress()
    ' Jefferson Scher 2/5/2002
    With Selection
    'Make sure we are in a table, if not, exit without a message
    If Not .Information(wdWithInTable) Then Exit Sub
    'Pop up the row number and column number in a message box
    MsgBox "Column: " & .Information(wdStartOfRangeColumnNumber) & vbCrLf & _
    " Row: " & .Information(wdStartOfRangeRowNumber)
    End With
    End Sub</pre>

    I'm not sure if there is a built-in way to convert the column numbers to letters, but there are lot of ways to write code to do it. For example, this works, but only up to Z:
    <pre>Sub CellAddress()
    ' Jefferson Scher 2/5/2002
    With Selection
    'Make sure we are in a table, if not, exit without a message
    If Not .Information(wdWithInTable) Then Exit Sub
    'Pop up the row letter and column number in a message box
    MsgBox "Column: " & Chr(64 + .Information(wdStartOfRangeColumnNumber)) & vbCrLf & _
    " Row: " & .Information(wdStartOfRangeRowNumber)
    End With
    End Sub</pre>

    If you're confident, you can collapse it to this:
    <pre>Sub CellAddress()
    ' Jefferson Scher 2/5/2002
    With Selection
    'Make sure we are in a table, if not, exit without a message
    If Not .Information(wdWithInTable) Then Exit Sub
    'Pop up the cell reference in a message box
    MsgBox Chr(64 + .Information(wdStartOfRangeColumnNumber)) & _
    .Information(wdStartOfRangeRowNumber)
    End With
    End Sub</pre>

    Finally, if the message box is annoying, you can write to the Status Bar. Note that it might quickly disappear, but it's convenient for a quick look-see:
    <pre>Sub CellAddress()
    ' Jefferson Scher 2/5/2002
    With Selection
    'Make sure we are in a table, if not, exit without a message
    If Not .Information(wdWithInTable) Then Exit Sub
    'Pop up the cell reference in a message box
    StatusBar = "Cell " & Chr(64 + .Information(wdStartOfRangeColumnNumber)) & _
    .Information(wdStartOfRangeRowNumber)
    End With
    End Sub</pre>


Posting Permissions

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