Hi
I need help with Pivot filter. I have VBA that needs to does a lot of things and one of the requirement for filtering pivot is to filter anything that is "Apple" and "blank" rows. Some worksheets only has "Apples" and "Blank" rows. While some worksheets has "Orange", "Banana", "Apples", Blank" rows. But in anycase, i only need to just filter anything that is "Apple" and "Blank". Playing around with visible=true or false does not work. Can anyone help?
Sub test()
wb1.Sheets("test").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable4").PivotFields("Type"). _
CurrentPage = "(All)"
On Error Resume Next
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Type")
.PivotItems("Apple").Visible = False
.PivotItems("(blank)").Visible = True
End With
On Error Resume Next
End Sub
Bookmarks