I'd like to update the range of a pivot table but don't want to use a Table as the source.
I recorded a range change using the recorder. But is there a way to edit the Sub below, so that the SourceData in it is based on a block of data in Sheet3, and the block is based on this line?
Range("A2", Range("A2").End(xlToRight).End(xlDown)).Copy
I recorded a range change using the recorder. But is there a way to edit the Sub below, so that the SourceData in it is based on a block of data in Sheet3, and the block is based on this line?
Range("A2", Range("A2").End(xlToRight).End(xlDown)).Copy
VBA Code:
Sub change_pivot_range()
'
' change_pivot_range
'
ActiveSheet.PivotTables("PivotTable1").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"C:\Users\Documents\[Change Pivot Table source.xlsb]Sheet1!R1C1:R4C3", _
Version:=8)
End Sub