ahuang3433
New Member
- Joined
- Jan 24, 2017
- Messages
- 39
Hi,
I have this pivot table where if designates to filter out specific things. Is there a way to re-write this to where it skips the variable when it's not found?
I got an error to the 2nd to last variable because that is no longer an option.
I have this pivot table where if designates to filter out specific things. Is there a way to re-write this to where it skips the variable when it's not found?
I got an error to the 2nd to last variable because that is no longer an option.
VBA Code:
ActiveSheet.PivotTables("PivotTable2").PivotFields("Item Availability"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Item Availability")
.PivotItems("ETA On Time & Qty Ordered Less than Demand").Visible = False
.PivotItems("In Stock").Visible = False
.PivotItems("No Gating PO").Visible = False
.PivotItems("ETA Late").Visible = False
.PivotItems("ETA On Time").Visible = False
.PivotItems("ETA Late & Qty Ordered Less than Demand").Visible = False
.PivotItems("Partial qty in INV. Balance No Gating PO").Visible = False
End With