I have a macro that will delete all empty rows in every table in a document.
As I said in my previous post, there is an issue with tables in MS Word that have merged cells. You did not confirm that there are no merged cells in the tables.
If there are no merged cells this macro should work.
Please test this macro on a copy of your data.
Note that there is no undo with macros and changes made with a macro cannot be undone with the Undo button.
If this works OK with your test data, you should always backup your data before running this.
The macro should be added to the Normal document so that it is available to different report documents.
From Word, hit Alt + f11 (the Alt key and function #11 key together).
This opens the Visual Basic (VB) window.
The Project Explorer pane should be visible on the left (if not click the View menu in the VB window and select Project explorer).
Right-click on 'Normal' and select Insert and Module (not Class module)
Double click on the new module (typically Module1)
Copy and paste the following into the large code pane in the VB window.
Dim tblT As Table
Dim cllC As Cell
Dim blnEmpty As Boolean
Dim n As Integer
On Error GoTo ErrHnd
'loop through all tables in the document
For Each tblT In ActiveDocument.Tables()
'loop through each row in table, starting at the end
'of the table - so delete doesn't change row numbers
For n = tblT.Rows.Count To 1 Step -1
'set flag for empty row
blnEmpty = True
'go through each cell in row
For Each cllC In tblT.Rows(n).Cells()
'test if cell contains more than table marker
If cllC.Range.Characters.Count > 1 Then
'if any cell has more than table marker
'the cell and therefore the row is not empty
blnEmpty = False
'if all cells in row empty - delete row
If blnEmpty = True Then
Click File - Save from the VB menu
Use Alt + f11 to go back to the main Word window.
In the Word window, right click on a toolbar and select Customize
Select Commands, then Macros (scroll down to see this)
On the right side, your macro will be visible as Normal.Module1.DelBlankRows.
Click it and drag it onto a toolbar
Right-click the new 'button' and select 'Text only (In Menus)'
You will have a button (you can change or design a new icon image later).
Click close in the Customize dialog box.
Make the document with tables the active (selected) document, save as a copy.
Click the new button
The copy document should have all blank rows in tables deleted.
'Save as' final document if changes are acceptable.
PS if you have Word 2007, the steps for creating a button in the main Word window are different.