View Single Post
 
Old 04-04-2018, 01:58 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Cosmo View Post
That won't help me, since it will always set the table to nothing if the first row is empty. There may be other rows that were not deleted, and the table will need further processing.
In that case, try:
Code:
Dim Tbl As Table, r As Long
For Each Tbl In ActiveDocument.Tables
  With Tbl
    If Len(.Range.Text) = .Range.Cells.Count * 2 + .Rows.Count * 2 Then
      .Delete: Set Tbl = Nothing
    Else
      For r = .Rows.Count To 1 Step -1
        With .Rows(r)
          If Len(.Range.Text) = .Cells.Count * 2 + 2 Then
            .Delete
          End If
        End With
      Next
    End If
  End With
  MsgBox Tbl Is Nothing
Next
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote