View Single Post
 
Old 06-23-2021, 07:32 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

When two inline tables butt against each other, they join to become one table.

The code, as written, is duplicating the content of the second table. However, it is doing this immediately below the second table. (Without testing the code) I would expect this to be joined with Table(2) and hence Table(2) now includes the previous and duplicated content. If you run the macro again, you would expect that pair to double again (ie grow exponentially).

If you think the code is duplicating two separate tables, perhaps visually it appears as two tables but is actually just one. If you use the Select Table command, you should be able to see where a table actually starts and finishes.

The code could be amended to ensure there is a paragraph between the original and duplicated table to avoid the two accidently becoming merged. If the command button is pressed repeatedly, where do you want the new duplicate added? It could go after Table 2 always but then it sits between the original and the first duplicate (which might not be what you wanted).

FWIW, I believe you should be using a Repeating Content Control do be doing this without needing a macro. See this youtube video for an example of how to do this.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote