Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    What Row/cell/column am I In? (Word 2000)

    Hi Everybody
    I'm sure this is staring me in the face, but I can't see it.

    I want to find out what row number the insertion point is in within a table. I've looked at the Information property of selection, and I can also count the number of rows/columns in a table.

    Any pointers would be of help. Thanks.

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: What Row/cell/column am I In? (Word 2000)

    Hi Karen,

    You were almost there.... .Information(wdEndOfRangeRowNumber) seems to do it:

    <pre>Public Sub GetRowNumberofSelection()
    Dim lngRowNumber As Long
    If Selection.Information(wdWithInTable) = True Then
    If Selection.Rows.Count > 1 Then
    MsgBox "Selection must be in one row only..."
    Exit Sub
    End If
    lngRowNumber = Selection.Information(wdEndOfRangeRowNumber)
    MsgBox "Selection is in row number: " & lngRowNumber
    End If
    End Sub
    </pre>

    Gary

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: What Row/cell/column am I In? (Word 2000)

    Well, you're right, it was staring me in the face. I'd been looking at the list of constants <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

    Thanks for that, I can now complete my macro.

Posting Permissions

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