Macro acting up on another computer doing pivot table
Hi,
I recorded a Macro creating a Pivot table. It works fine into my computer, but when I send the file to another computer, the arrangement of the pivot table fields showed differently.
have 3 Sheets, data, Pivot & Summary. I changed the field setting into “show item labels in tabular form” & “Repeat item labels” when I recorded the Macro. The Pivot messed up, so the Summary messed up too because it was connected to Pivot.
Is there a way to fix the Pivot when I run the Macro into another computer?
Below is part of the Macro the arranged the fields:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
“Wall Panel_1!R2C1:R” & LastRow & “C9”, Version:=8).CreatePivotTable TableDestination:= _
“Pivot!R3C1″, TableName:=”PivotTable3”, DefaultVersion:=8
Sheets(“Pivot”).Select
Cells(3, 1).Select
With ActiveSheet.PivotTables(“PivotTable3”).PivotCache
.RefreshOnFileOpen = False
.MissingItemsLimit = xlMissingItemsDefault
End With
ActiveSheet.PivotTables(“PivotTable3”).RepeatAllLabels 2
With ActiveSheet.PivotTables(“PivotTable3”).PivotFields(“PANEL LOCATION”)
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables(“PivotTable3”).AddDataField ActiveSheet.PivotTables( _
“PivotTable3”).PivotFields(“COUNT”), “Sum of COUNT”, xlSum
With ActiveSheet.PivotTables(“PivotTable3”).PivotFields(“PANEL LENGTH”)
.Orientation = xlRowField
.Position = 2
End With
Hi, I recorded a Macro creating a Pivot table. It works fine into my computer, but when I send the file to another computer, the arrangement of the pivot table fields showed differently. have 3 Sheets, data, Pivot & Summary. I changed the field setting into “show item labels in tabular form” & “Repeat item labels” when I recorded the Macro. The Pivot messed up, so the Summary messed up too because it was connected to Pivot. Is there a way to fix the Pivot when I run the Macro into another computer? Below is part of the Macro the arranged the fields: ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _”Wall Panel_1!R2C1:R” & LastRow & “C9″, Version:=8).CreatePivotTable TableDestination:= _”Pivot!R3C1″, TableName:=”PivotTable3”, DefaultVersion:=8Sheets(“Pivot”).SelectCells(3, 1).SelectWith ActiveSheet.PivotTables(“PivotTable3”).PivotCache.RefreshOnFileOpen = False.MissingItemsLimit = xlMissingItemsDefaultEnd WithActiveSheet.PivotTables(“PivotTable3”).RepeatAllLabels 2With ActiveSheet.PivotTables(“PivotTable3”).PivotFields(“PANEL LOCATION”).Orientation = xlRowField.Position = 1End WithActiveSheet.PivotTables(“PivotTable3″).AddDataField ActiveSheet.PivotTables( _”PivotTable3”).PivotFields(“COUNT”), “Sum of COUNT”, xlSumWith ActiveSheet.PivotTables(“PivotTable3”).PivotFields(“PANEL LENGTH”).Orientation = xlRowField.Position = 2End With Read More