I am trying to achieve the goal of automating a support template. The function I am working on is creating a button or drop down selection button that will auto pivot from the excel table to the desired pivot tables. The code below is creating a pivot table on a sheet that already exists. I am trying to figure out how my macro can be changed to where there is no sheets made (other than the one with the excel table on it) before running to macro and once it's ran it will create the new sheet and pivot table automatically. This is were I am stuck at. I tried record these steps but if I made changes to the code it would break.
Sub SelfPivot()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng1 As Range
Set wb = ActiveWorkbook
Set ws = wb.Sheets("Data insert")
Set rng1 = ws.Cells.Find("*", ws.[a1], xlFormulas, , , xlPrevious)
Sheets("Data insert").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Data insert!R1C1:R" & CStr(rng1.Row) & "C" & CStr(rng1.Column), Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="Reclass_PushBack!R3C1", TableName:="ReclassPORequesters", DefaultVersion _
:=xlPivotTableVersion10
Sheets("Reclass_PushBack").Select
Cells(3, 1).Select
End Sub