Hi,
I have created a pivot table for fixed cell range which has the code below in the starting:
As can be seen Pivot table is being created in Sheet1 for cell ranges R1C1 upto R320C4 included in Test sheet
What I would like is to convert the above code so cell ranges is always Dynamic and Pivot will be always created for that Dynamic cell ranges. The column count of the source cell range will remain fixed as 5 but row count will be dynamic.
Any advice would be nice.
I have created a pivot table for fixed cell range which has the code below in the starting:
VBA Code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Test!R1C1:R320C4", Version:=6).CreatePivotTable _
TableDestination:="Sheet1!R3C1", TableName:="PivotTable2", DefaultVersion _
:=6
As can be seen Pivot table is being created in Sheet1 for cell ranges R1C1 upto R320C4 included in Test sheet
What I would like is to convert the above code so cell ranges is always Dynamic and Pivot will be always created for that Dynamic cell ranges. The column count of the source cell range will remain fixed as 5 but row count will be dynamic.
Any advice would be nice.