CacheIndex Property Example

This example sets the cache for the PivotTable report named "Pivot1" to the cache of the PivotTable report named "Pivot2."

Worksheets(1).PivotTables("Pivot1").CacheIndex = _
    Worksheets(1).PivotTables("Pivot2").CacheIndex