Joining two tables

K

Kobus Botha

How do you line up columns of two tables with the same number of columns with
one another before joining them.
 
D

Doug Robbins - Word MVP

If you increase the zoom and then hold down the Alt key as you adjust the
columns widths, you should be able to get things to line up.

If however, that is too difficult, the following macro will append the data
from the second table in a document to the first table in the document

Dim source As Table
Dim target As Table
Dim newRow As Row
Dim i As Long, j As Long
Dim data As Range
With ActiveDocument
Set target = .Tables(1)
Set source = .Tables(2)
End With
With source
For i = 1 To .Rows.Count
Set newRow = target.Rows.Add
For j = 1 To .Columns.Count
Set data = .Cell(i, j).Range
data.End = data.End - 1
newRow.Cells(j).Range.Text = data.Text
Next j
Next i
.Delete
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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