I'm trying to get this code so that it will take data from "Sheet1" and put into "Sheet2" of the workbook. The first three lines are the ones giving me trouble.
Thanks for your help.

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!", Version:=xlPivotTableVersion15).CreatePivotTable _
TableDestination:="Sheet2!R2C2", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion15
Sheets("Sheet2").Select
Cells(2, 2).Select
With ActiveSheet.PivotTables("PivotTable1")
.InGridDropZones = True
.RowAxisLayout xlTabularRow
End With