Change Data Source for Multiple Pivot Tables

W

WolfgangPD

I have multiple pivot tables in one workbook and would like to change the
data source on all of the pivot tables. Is there a way to do this all at
once instead of selecting each table? The data is contained in another Excel
workbook. Thanks!
 
G

galimi

You can iterate through, and change, the source using the sourcedata property
for the pivottable.

sheet1.PivotTables(1).sourcedata
 
Top