View Single Post
 
Old 09-19-2021, 03:06 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
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

I suspect there is no simple way to address this during the merge, however should be simple enough to produce a macro to ensure there were the appropriate number of empty paragraphs in each cell to produce the required spacing after the merge.
The following macro assumes that there are twelve empty paragraphs and four populated paragraphs at the top of each cell (including 1 value below the coloured line). Merge to a new document and then run the macro.

Code:
Sub Macro1()
'Graham Mayor - https://www.gmayor.com - Last updated - 19 Sep 2021
Dim oTable As Table
Dim oCell As Cell
Dim oRng As Range, oLast As Range
Dim i As Long, j As Long, k As Long, m As Long

    For Each oTable In ActiveDocument.Tables
        For Each oCell In oTable.Range.Cells
            Set oRng = oCell.Range
            j = 0: m = 0
            For i = 1 To oRng.Paragraphs.Count
                If Len(oRng.Paragraphs(i).Range) > 2 Then
                    j = j + 1
                Else
                    m = m + 1
                End If
            Next i
Debug.Print j & vbTab & m
            If j > 4 And m = 12 Then
                For k = 5 To j
                    Set oLast = oRng.Paragraphs(oRng.Paragraphs.Count - 1).Range
                    oLast.Delete
                Next k
            End If
        Next oCell
    Next oTable
lbl_Exit:
    Set oTable = nothinh
    Set oCell = Nothing
    Set oRng = Nothing
    Set oLast = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote