The macro I created told you WHICH table has the most columns. Surely that was your original question.
Quote:
Originally Posted by Cendrinne
I wish to have a macro to count for me the table with the most columns.
So among my 100's of tables, have a macro that would tell me ''the table with the most columns is 10 in this currant Word document''...
|
If my macro was telling you 5 then that means the 5th table has the most columns. I also included that column count in the MsgBox title - although Greg thought that was an error and he moved it to the body of the MsgBox.
Did you also want to scroll to that (first) table with the most columns? If so, add another line at the bottom of the code
Code:
If iTbl > 0 Then ActiveDocument.Tables(iTbl).Range.Select