View Single Post
 
Old 01-07-2016, 03:50 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
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

You don't say which column the 0 values are in. The following macro processes all tables in the document, deleting those rows that have 0 values in column 2. You can change to column reference to suit your needs.
Code:
Sub DeleteTable0Rows()
Dim Tbl As Table, i As Long, Rng As Range
With ActiveDocument
  For Each Tbl In .Tables
    With Tbl
      For i = .Rows.Count To 1 Step -1
        Set Rng = .Cell(Row:=1, Columns:=2)
        With Rng
          .End = .End - 1
          If .Text = "0" Or .Text = "0.0" Or .Text = ".0" Then .Rows(1).Delete
        End With
      Next
    End With
  Next
End With
Set Rng = Nothing: Set Tbl = Nothing
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote