M
murkaboris
Hello:
I've recorded a macro in which I'm copy-pasting the same pivot table in the
same worksheet and then changing the display of number inside to show as % of
column but am receiving:
Run-time error '1004' - Unable to get the PivotTables property of the
Worksheet class
The error highlights the following portion of the macro:
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Amount")
Here is portion of the macro including the line above that is highlighted
when I click on "Debug":
Range("A4:G14").Select
Range("G14").Activate
Selection.Copy
Range("J4").Select
ActiveSheet.Paste
Columns("J:J").EntireColumn.AutoFit
Columns("K").Select
Selection.ColumnWidth = 8.8
Range("K814").Select
Application.CutCopyMode = False
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Amount")
.Calculation = xlPercentOfColumn
.NumberFormat = "0.00%"
End With
Please help, I'm not too good with macros .
Thank you.
Monika
I've recorded a macro in which I'm copy-pasting the same pivot table in the
same worksheet and then changing the display of number inside to show as % of
column but am receiving:
Run-time error '1004' - Unable to get the PivotTables property of the
Worksheet class
The error highlights the following portion of the macro:
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Amount")
Here is portion of the macro including the line above that is highlighted
when I click on "Debug":
Range("A4:G14").Select
Range("G14").Activate
Selection.Copy
Range("J4").Select
ActiveSheet.Paste
Columns("J:J").EntireColumn.AutoFit
Columns("K").Select
Selection.ColumnWidth = 8.8
Range("K814").Select
Application.CutCopyMode = False
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Amount")
.Calculation = xlPercentOfColumn
.NumberFormat = "0.00%"
End With
Please help, I'm not too good with macros .
Thank you.
Monika