How to Determine the Position of a Cell Within a Table

Last reviewed: July 30, 1997
Article 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

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.

Kbcategory: kbusage kbmacro kbhowto KBSubcategory: kbtable


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 : 2.0 2.0a 2.0a-CD 2.0b 2.0c
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.