View Single Post
 
Old 11-21-2023, 03:05 PM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

What if your table is too big to fit on a page?


As long as each table will fit on a page, you could use something like this:

Code:
Sub KeepRowsTogether()
Dim oTbl As Table, oCel As Cell
  For Each oTbl In ActiveDocument.Tables
    oTbl.Range.Paragraphs.KeepWithNext = True
    For Each oCel In oTbl.Rows.Last.Range.Cells
      oCel.Range.Paragraphs.Last.KeepWithNext = False
    Next oCel
  Next oTbl
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote