View Single Post
 
Old 05-09-2017, 01:09 AM
NevilleT NevilleT is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Mar 2015
Posts: 29
NevilleT is on a distinguished road
Default Nested tables. Count rows

I have a series of tables with nested tables. There may be more than one nested table in each primary table cell.

I want a procedure that counts the number of rows in whichever table is the current selection (assuming it is a nested table). I know how to verify it is nested, so that is not the problem.

Once I know the number of rows, I want to number from cell(2,1) - below the header - by entering text "1. ", movedown, "2. " etc. Think I can do that if I can identify the nested table.

Problem is that a primary table might have two or three nested tables in one cell. If the cursor is in nested table 2, I can use:

intRowNos = Selection.Tables(1).Tables(2).Rows.Count

but how do I cater for the fact it could be in Tables(2) or (1) or even (3)?
Reply With Quote