![]() |
#4
|
||||
|
||||
![]()
If there's a bookmark in table 4, the code can be simplified e.g as below, where I have also provided different options for each of the four tables if required.
Code:
If ActiveDocument.Tables.Count > 3 Then If ActiveDocument.Tables(4).Range.Bookmarks.Exists("bmName") = True Then For i = 1 To 4 Set oTable = ActiveDocument.Tables(i) 'Do something with otable e.g. Select Case i Case Is = 1 oTable.Cell(1, 1).Range.Text = "Test" Case Is = 2 oTable.Cell(1, 1).Range.Text = "Test2" Case Is = 3 oTable.Cell(1, 1).Range.Text = "Test3" Case Is = 4 oTable.Cell(1, 1).Range.Text = "Test4" End Select Next i End If End If
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for a macro for word count in one specific column of table, only rows with white background | mobj | Word VBA | 2 | 10-17-2019 03:09 AM |
![]() |
JellehFishh | Word VBA | 2 | 06-27-2019 08:23 AM |
Linking Specific text fields in PP to specific cells in an Excel table | GWRW1964 | PowerPoint | 0 | 02-26-2018 07:37 AM |
![]() |
jc491 | Word VBA | 8 | 09-30-2015 06:10 AM |
![]() |
Lebber | Word | 9 | 02-01-2013 12:31 AM |