View Single Post
 
Old 08-03-2014, 07:00 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Collapse, as its name suggests, collapses the range to either end - you can use wdCollapseStart or wdCollapseEnd.

Your previous post indicated the tables were being merged, which implied to me that one was being inserted into the other. What the code I posted does is to append the tables. If you want to insert the replicated content as a new table, you need to have an empty paragraph between them, which you could create with something like:
Code:
Sub Demo()
Dim Rng As Range
With ActiveDocument
  Set Rng = .Tables(1).Range
  Rng.Collapse wdCollapseEnd
  Rng.FormattedText = .Tables(1).Range.FormattedText
  Rng.Tables(1).Split Rng.Rows(1)
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote