MsgBox ActiveSheet.PivotTables(1).PivotCache.SourceData
ActiveSheet.PivotTables(1).PivotCache.SourceData = _
"'Sheet2'!A1:J65536"
Sub ChangePivotCache()
'pivot table tutorial by contextures.com
'change pivot cache for all Pivot Tables in workbook
Dim pt As PivotTable
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
For Each pt In wks.PivotTables
pt.CacheIndex = Sheets("Pivot").PivotTables(1).CacheIndex
Next pt
Next wks
End Sub