hi,
i want one of the pivot field in data as sum, but that columnheader will be changing every time the users runs the macro.
is there any solution for this.
Thanks!
Printable View
hi,
i want one of the pivot field in data as sum, but that columnheader will be changing every time the users runs the macro.
is there any solution for this.
Thanks!
Welcome to board !
Post your code.
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDa tabase, SourceData:= _
"Sheet1!R1C1:R19C12", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion12
Sheets("Sheet4").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Region")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable1").AddDataFiel d ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Sum of Feb usd @1.3881 "), _
"Count of Sum of Feb usd @1.3881 ", xlCount
With ActiveSheet.PivotTables("PivotTable1").PivotFields ( _
"Count of Sum of Feb usd @1.3881 ")
.Caption = "Sum of Sum of Feb usd @1.3881 "
.Function = xlSum
End With
End Sub
the header "sum of feb usd @1.3881 can change