![]() |
|
|
|
#1
|
||||
|
||||
|
I haven't done rigorous testing but this should get you started Code:
Sub TestTables()
Dim i As Integer, x As Integer, iTbl As Integer, sOthers As String
For i = 1 To ActiveDocument.Tables.Count
If ActiveDocument.Tables(i).Columns.Count > x Then
x = ActiveDocument.Tables(i).Columns.Count
iTbl = i
sOthers = ""
ElseIf ActiveDocument.Tables(i).Columns.Count = x Then
sOthers = sOthers & i & ", "
End If
Next i
If sOthers <> "" Then sOthers = "Other tables with same column count are: " & sOthers
MsgBox "The table with the most columns is " & iTbl & vbCr & sOthers, , x & " Columns"
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
| Tags |
| help please, most table column |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VBA to add final touches to merged document, after running MailMergeToDoc script | NicB | Word VBA | 1 | 09-02-2020 05:47 PM |
| How to generate a word document with a table-script | valdavaux | Word | 1 | 09-17-2017 03:32 PM |
| Is it possible to put a formula in a table column header to define the name of the column? | JacquesW | Excel | 3 | 05-08-2017 08:00 AM |
| VBA to search each row of a word table column | Marrick13 | Word VBA | 7 | 11-17-2014 04:33 AM |
two column word document.
|
plato | Word | 1 | 08-06-2010 04:02 AM |