justdream
08-29-2011, 09:09 AM
Dears,
I’d like to create macro, do some calculations and charts using pivot table..
My concern is to design macro selecting all the data in the sheet to be used for Pivot analysis
Whatever the number of existing columns
I’m already using below code:
Cells.Select
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R1C1:R1048576C151", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sheet4!R1C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion14
But I;ve tested it after deleting few columns from my inout file and it has give me Debug error message
Kindly advice how to sort this issue out
I’d like to create macro, do some calculations and charts using pivot table..
My concern is to design macro selecting all the data in the sheet to be used for Pivot analysis
Whatever the number of existing columns
I’m already using below code:
Cells.Select
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R1C1:R1048576C151", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sheet4!R1C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion14
But I;ve tested it after deleting few columns from my inout file and it has give me Debug error message
Kindly advice how to sort this issue out