I have searched a lot of forums but still haven't found the answer for this:
I am trying to filter my row label which varies from 1 to 10, in order to only show me 5 and 10.
I wrote the following code, but it produces error 1004 "Unable to get the PivotFields property of the PivotTable class".
ActiveWorkbook.Sheets("SideCalculations-KPIs").Activate
With ActiveSheet.PivotTables("PivotTable1").PivotFields("ToStateId")
.ClearAllFilters
.PivotItems("5").Visible = True
.PivotItems("10").Visible = True
End With
thanks in advance
?Sheets("SideCalculations-KPIs").PivotTables("PivotTable1").PivotFields(1).name- it may be that the name ToStateId is wrong - Our Man in Bananas