Hide Zero Values in a pivottable

ijswalker

Registered User.
Local time
Yesterday, 23:42
Joined
Jun 16, 2008
Messages
67
Hi

I am trying to hide zero values in a pivottable in excel. I have tried the following code but can't seem to get it to work

Sub hidezerovalues_Click()
Dim pf As PivotField
Dim pi As PivotItem
Set pf = ThisWorkbook.Worksheets("POPIV").PivotTables("PIV_PO_DETAIL").PivotFields("PROJECT_NUMBER")
For Each pi In pf.PivotItems
If pi.Value = 0 Then pi.Visible = False
Next pi
End Sub


I have a row field of "Project_Number" and a column field of "Year" and a page item of "QTR". The value is "Sum of OPEN_PO_AMOUNT"

I have some values that are zero and I want to exclude then from my report.

Can anyone help?

Ian
 
don't know if you HAVE to do it programmatically, but if not, there is a check-box in the options (or maybe 'veiw', or 'advanced', etc, depending on the version) that gives you an option to show or not to show zeros on a worksheet, including pivot tables..
l
 

Users who are viewing this thread

Back
Top Bottom