pivot tables

  • Thread starter Thread starter Vince
  • Start date Start date
V

Vince

How do I delete rows where the sum in the column equals
zero? Can this be done automatically?
 
The following macro by John Green will hide the rows which total zero:

Sub HideZeroRows()
'hide worksheet rows that contain all zeros
'by John Green
Dim rRow As Range

For Each rRow In ActiveSheet _
.PivotTables(1).DataBodyRange.Rows
If Application.Sum(rRow) = 0 Then
rRow.EntireRow.Hidden = True
Else
'DD--I added this to unhide
'any previously hidden rows
rRow.EntireRow.Hidden = False
End If
Next rRow
End Sub
 
Back
Top