View Single Post
 
Old 07-24-2021, 08:19 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

To fix your table you need to delete the unwanted rows e.g. as below however this looks like a many to one mail merge.See Merge Many To One
Code:
Sub Macro1()
Dim i As Long
Dim oTable As Table
Dim oRng As Range
    Set oTable = ActiveDocument.Tables(1)
    For i = oTable.Rows.Count To 3 Step -1
        Set oRng = oTable.Rows(i).Cells(1).Range
        oRng.End = oRng.End - 1
        If oRng.Text = "Assessment/Category" Or oRng.Text = "" Then
            oTable.Rows(i).Delete
        End If
    Next i
    Set oTable = Nothing
    Set oRng = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com

Last edited by gmayor; 07-24-2021 at 11:28 PM.
Reply With Quote