I have a pivot table in my workbook. I would like to change the PivotTable Field function to VarP using a macro but receive an error when it runs.
I recorded the macro and then tried to run the code but the following error appears:
"Unable to get the PivotFields property of the PivotTable class"
The code given by the recorder is:
I need to change to the variance so that I can check for any discrepancies (i.e. if variance is not 0 then there is a problem)
I hope some can help or suggest any easier way to perform this.
I recorded the macro and then tried to run the code but the following error appears:
"Unable to get the PivotFields property of the PivotTable class"
The code given by the recorder is:
Code:
Range("A3").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Varp of Full Cost"). _
Function = xlVarP
I need to change to the variance so that I can check for any discrepancies (i.e. if variance is not 0 then there is a problem)
I hope some can help or suggest any easier way to perform this.