Hi All,
I have arranged data using a pivot table and want to display the data
using a pivot chart, which I have been able to do.
I have recorded a basic macro which should (in theroey) change the Value field in the pivot table. However when i run the macro I get the following error message:
Run-Time error 1004
Unable to get the PivotFields property of the Pivoit Table Class.
The code is as follows:
Sub Water()
'
' Water Macro
Sheets("Sheet1").Select
Range("I2").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Count of Result"). _
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Water"), "Count of Water", xlCount
ActiveWorkbook.ShowPivotTableFieldList = False
Sheets("Flux Levels").Select
End Sub
When I run the deubg option the error seems to be occuring on the 3rd and 4th lines of the code.
Any suggestions?
Thanks!
Bookmarks