Hi nawGo,
An alternative to newdoverman's method is to use variables in the code to calculate the dimensions of your table.
The code below simulates the code you posted, but includes the variables to calculate the source table size and factor this into the creating of a new pivot.
Sheets.Add
Dim lRC As Long, lCC As Long
lRC = Worksheets("Raw").Range("A" & Worksheets("Raw").Rows.Count).End(xlUp).Row 'Calculate the row height of the source date
lCC = Worksheets("Raw").Columns(Worksheets("Raw").Columns.Count).End(xlToLeft).Column 'Calculate the column width of the source date
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Raw!R1C1:R" & lRC & "C" & lCC, Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:=Range("A3"), TableName:="PivotTable3", DefaultVersion _
:=xlPivotTableVersion14
Cells(3, 1).Select
Bookmarks