Hi,
I attached the output of the macro,
I assumed as the following is the VB script to merge the "Tables".
Merging to Tables
Any of the previous examples can produce their output in a table format. All you need to do is to replace the heading & data lines in the field code with an equivalent table. When you do so, however, each record becomes a one-row table, as per the ‘Calculating Group and Sub-Group Totals’ example (page 14). To turn that output into one table per group you can run the following ‘TableJoiner’ macro after completing the merge.
Sub TableJoiner()
Application.ScreenUpdating = False
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
With oPara.Range
If .Information(wdWithInTable) = True Then
With .Next
If .Information(wdWithInTable) = False Then
If .Text = vbCr Then .Delete
End If
End With
End If
End With
Next
Application.ScreenUpdating = True
End Sub
Regards,
Ali Mubarak
|