How do I change source data range for an existing Pivot Table?

  • Thread starter Thread starter Paolo Sardi
  • Start date Start date
P

Paolo Sardi

Hi,

I'm trying to change, through Excel VBA code, the source data range for an
existing Pivot Table.

Is there a way to set a new data source range for an existing Pivot Table?

Thank you.
 
Hi Paolo,
Try:
Range("K4").Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:=ActiveSheet.Range("NewDataSourceRange")
The range selected (K4 here) should be a cell within the pivot table.
Paul
 
Back
Top