Hello VBA checkers,
i wrote a word2000 macro, where i have to put two tables together. The
problem is that the second table can have one more column than the
first. I just want to glue both tables together to one.
The following code does this job, but it is very slow. I'd like to
connect two tables with over 1000 rows:
'add one row, on this row the new ones are added
firstTable.Rows.Add
For Each row In secondTable.Rows
firstTable.Rows(firstTable.Rows.Count).Range.FormattedText =
row.Range.FormattedText
Next
'remove last row, its empty
firstTable.Rows(firstTable.Rows.Count).Delete
Did someone knows a better, and faster way to do this job?
Thanks, in advance
Sebastian
Helmut Weber - 26 Apr 2005 13:28 GMT
Hi Sebastian,
I wonder,
as here and now, 2 tables, one with 5 columns
and another one with 4 columns,
seperated e.g. by an empty paragraph,
will merge without any problem,
just by removing what seperates them.
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000