Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 04-16-2021, 04:00 PM
macropod's Avatar
macropod macropod is offline Adding new rows to a table Windows 10 Adding new rows to a table Office 2016
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

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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Adding Rows To Table With Content Control lord_kaiser Word VBA 2 08-01-2020 01:01 AM
Adding new rows to a table Add Rows to table that will include content controls of previous rows bobsagat Word VBA 20 01-27-2020 08:00 AM
Adding new rows to a table Adding Rows to a Table SuzeG Word VBA 8 01-02-2014 08:05 AM
Adding new rows to a table Grouping table rows to prevent individual rows from breaking across pages dennist77 Word 1 10-29-2013 11:39 PM
Adding new rows to a table adding rows to word table hklein Word VBA 4 07-18-2011 12:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft