Hi Team,
Greetings!!!
In my daily job I use excel frequently and working on huge data in order to get the desire reports. I have recorded PIVOT to get the reports quickly but it is not working. I think need customize the Vba code in order to run this macro. It would work if I extract report in same sheet in a workbook but not able to extract to different sheet.
Can anyone help me in order to customize the codes and refer below codes when I recorded PIVOT table in a new sheet.
Thanks
Debug Code
ActiveWorkbook.Worksheets("By Product").PivotTables("PivotTable1").PivotCache. _
CreatePivotTable TableDestination:="Sheet3!R3C1", TableName:="PivotTable2" _
, DefaultVersion:=xlPivotTableVersion12
Sheets("Sheet3").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Product")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("Customer"), "Count of Customer", xlCount
Range("C19").Select
Greetings!!!
In my daily job I use excel frequently and working on huge data in order to get the desire reports. I have recorded PIVOT to get the reports quickly but it is not working. I think need customize the Vba code in order to run this macro. It would work if I extract report in same sheet in a workbook but not able to extract to different sheet.
Can anyone help me in order to customize the codes and refer below codes when I recorded PIVOT table in a new sheet.
Thanks
Debug Code
ActiveWorkbook.Worksheets("By Product").PivotTables("PivotTable1").PivotCache. _
CreatePivotTable TableDestination:="Sheet3!R3C1", TableName:="PivotTable2" _
, DefaultVersion:=xlPivotTableVersion12
Sheets("Sheet3").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Product")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("Customer"), "Count of Customer", xlCount
Range("C19").Select