Does anyone know why my code won't create a Pivot Table?
Thanks
Sub create_pivot_table()
mc = Range("A1000000").End(xlUp).Row
mcc = Range("XFC1").End(xlToLeft).Column
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!(cells(1,1),cells(mc, mcc))", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion14
Sheets("Sheet4").Select
Cells(3, 1).Select
End Sub
Thanks
Sub create_pivot_table()
mc = Range("A1000000").End(xlUp).Row
mcc = Range("XFC1").End(xlToLeft).Column
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!(cells(1,1),cells(mc, mcc))", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion14
Sheets("Sheet4").Select
Cells(3, 1).Select
End Sub