Identifying table ranges

W

Wylie C

I have a Word document with two columns. I inserted a table to span both
columns but had to force a column break to balance the data. I have not
worked with coding much in Word and cannot find an answer to my problems. I
can't figure out how to identify the two (seemingly) different tables ranges.
If I select the table in the first column, only the table in that column is
selected. I want to search for data in both columns/tables to update
information. How do I set ranges for these two tables so I can use it in my
loop statement? I need as much of the source code as possible please.

Thank you.
 
C

Chuck

I'm working in Word 2000 so your experience may vary:

When I inserted a column break in a table in the left column, the table
split but a column break didn't get inserted. I had to insert a column break
again for the table to move to the next column. This means that where once
there was one table now there are two (the first insert column break created
two tables from one).

Either of the following alternative approaches should get you going:

Sub Alternative1()

With ActiveDocument
With .Tables(1)
'table in left column
GoSub TableCode
End With
With .Tables(2)
'table in right column
GoSub TableCode
End With
End With

Exit Sub

TableCode:

'your code here

Return

End Sub

Sub Alternative2()

Dim tblTable As Table

Set tblTable = ActiveDocument.Tables(1)

GoSub TableCode

Set tblTable = ActiveDocument.Tables(2)

GoSub TableCode

Exit Sub

TableCode:

'your code here

Return

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top