Hi All,
Need some ideas on how to go about accomplishing this. I have a userform that I would like to add a commandbutton to that creates a Pivot Table. The code below creates a pivot table on a specfic sheet. How would I modify this code to create a PivotTable on the next available unnamed sheet?
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Raw_Data", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Sheet2!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion12
Sheets("Sheet2").Select
Cells(3, 1).Select
Sheets("Sheet2").Name = "CLINS 1_17_18_19 - DLR" 'renames sheet
Call Pivot_Data(FiscalMonth)
CLIN_1_17_18_19
Call Format_Pivot(FiscalMonth)
Need some ideas on how to go about accomplishing this. I have a userform that I would like to add a commandbutton to that creates a Pivot Table. The code below creates a pivot table on a specfic sheet. How would I modify this code to create a PivotTable on the next available unnamed sheet?
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Raw_Data", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Sheet2!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion12
Sheets("Sheet2").Select
Cells(3, 1).Select
Sheets("Sheet2").Name = "CLINS 1_17_18_19 - DLR" 'renames sheet
Call Pivot_Data(FiscalMonth)
CLIN_1_17_18_19
Call Format_Pivot(FiscalMonth)