T
Todd Huttenstine
The below code is supposed to sort each pivotfield in
pagefield by ascending order. I am getting the
error "Unbale to get the pivotfields property of the
PivotTable class" What is wrong with the code?
Dim PvtTable
Dim CurrentPageField
Set PvtTable = Worksheets("Wkly Renewals").PivotTables
("PivotTable4")
For Each pvtitem In PvtTable.PageFields
CurrentPageField = pvtitem.Name
ActiveSheet.PivotTables("PivotTable4").PivotFields
(pvtitem).AutoSort _
xlAscending, pvtitem
Next
pagefield by ascending order. I am getting the
error "Unbale to get the pivotfields property of the
PivotTable class" What is wrong with the code?
Dim PvtTable
Dim CurrentPageField
Set PvtTable = Worksheets("Wkly Renewals").PivotTables
("PivotTable4")
For Each pvtitem In PvtTable.PageFields
CurrentPageField = pvtitem.Name
ActiveSheet.PivotTables("PivotTable4").PivotFields
(pvtitem).AutoSort _
xlAscending, pvtitem
Next