How to Determine the Position of a Cell Within a Table

ID: Q89807


The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c


SUMMARY

To determine the position (row and column number) of a cell in a table, follow the procedure below or use the macro below it.

Procedure

  1. Position the insertion point in a table cell.


  2. From the Table menu, choose Row Height. The row number is "X" in the Height Of Row <X> box title. Choose the Cancel button.


  3. From the Table menu, choose Column Width. The column number is "X" in the Width Of Column <X> box title. Choose the Cancel button.


Macro


   Sub Main
   MaxCol = SelInfo(18)
   Row = SelInfo(13)
   Col = SelInfo(16)
   If(Row = - 1) Or(Col > MaxCol) Then
      Print "Selection not in Table"
   Else
      Print "Row " ; Row ; ",  Column " ; Col
   End If
   End Sub 
To use the above macro, position the insertion point in a table cell and run the macro. The row and column number appear on the status line in the following format:
Row x, Column x
If the cursor is not in a table cell when you run the macro, the following error message appears on the status line:
Selection not in Table
NOTE: Information provided in this document is provided "as is"without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Additional query words: winword2 number 3.10 win31 word6 winword 2.0 2.0a 2.0a-CD 2.0b 2.0c 6.0 6.0a 6.0c

Keywords : kbtable
Version : WINDOWS:2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c
Platform : WINDOWS
Issue type :


Last Reviewed: December 28, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.