Hi all, newish to VBA, but picking up quickly. Sometimes the value in the filter is not in the data, and causes my vba to bug out on me. I commented it out, but would like to write something that would allow the code to finish by ignoring the criteria if it is unavailable.
PHP:
With ActiveSheet.PivotTables("PivotTable5").PivotFields("SD Delivery Block")
' .PivotItems("89").Visible = False commented out due to failure
' .PivotItems("91").Visible = False
' .PivotItems("92").Visible = False
' .PivotItems("93").Visible = False
' .PivotItems("94").Visible = False
' .PivotItems("95").Visible = False
' .PivotItems("97").Visible = False
' .PivotItems("CR").Visible = False
' .PivotItems("(blank)").Visible = False