It can be used repeatedly as long as you close each instance of
With ActiveDocument.Tables(#) ...
with an
End With
statement
Or you might want to run the same code on some multiple tables:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim lngIndex As Long
For lngIndex = 1 To ActiveDocument.Tables.Count
Select Case lngIndex
Case 1 To 4
With ActiveDocument.Tables(lngIndex)
.Cell(1, 1).Range.Text = "A"
End With
Case 5, 6
With ActiveDocument.Tables(lngIndex)
.Cell(1, 1).Range.Text = "B"
End With
Case 7
With ActiveDocument.Tables(lngIndex)
.Cell(1, 1).Range.Text = "C"
End With
End Select
Next
End Sub