View Single Post
 
Old 10-07-2019, 08:17 PM
fly545 fly545 is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2019
Posts: 7
fly545 is on a distinguished road
Default

So I have almost gotten through to the end, however, whenever icount >2 the table pastes next to the previous table it pasted when i need it within its own table below.

Code:
Dim i As Integer
Dim iCount As Integer
Dim Rng As Range


iCount = InputBox("How many duplicates?", , "1")

Set Rng = ActiveDocument.Bookmarks("Generator").Range

If iCount = 0 Then
        Rng.Select
        Rng.Delete
Else
    For i = iCount To 2 Step -1
    Set Rng = ActiveDocument.Bookmarks("Generator").Range
    Rng.Select
    Rng.Collapse wdCollapseEnd
    Rng.Select
    
    Rng.Paste
    'insert paragraph here
      
    Next i
End If
is there a way to do that?
Reply With Quote