Thread: [Solved] Adding new rows to a table
View Single Post
 
Old 04-16-2021, 04:00 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Using the coding approach I suggested with the thicker borders (6pt is the max), you could use:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim RngSrc As Range, RngTgt As Range
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  With .Tables(1)
    Set RngSrc = .Rows(.Rows.Count).Range
    Set RngTgt = .Range
    RngTgt.Collapse wdCollapseEnd
    RngTgt.FormattedText = RngSrc.FormattedText
    .Rows(.Rows.Count ).Range.Delete
    .Rows(.Rows.Count ).Cells(1).Range.Text = (.Rows.Count - 1) 
  End With
End With
Application.ScreenUpdating = True
End Sub
With this approach, whatever formatting, shading etc. is applied to your existing last row is replicated in the new one.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote