Hi all,
i am running some code which loops through the pivot table on a sheet and applies a filter. Not all of the pivot tables have the filter field though. Is there something i can do to test whether the filed is on the pivot first??
i have this...
For Each pivotTbl In pivotSht.PivotTables
pivotNm = pivotTbl.Name
pivotSht.PivotTables(pivotNm).PivotFields("tier").CurrentPage = "(All)"
With pivotSht.PivotTables(pivotNm).PivotFields("tier")
.PivotItems("1").Visible = True
.PivotItems("2").Visible = True
.PivotItems("NP").Visible = True
End With
Next
..but if the filed 'tier' doesn;t exist i ge an error.
Thanks,
Spin.
Bookmarks