redefining the SourceData of a PivotCache

lalbatros

Well-known Member
Joined
Sep 5, 2007
Messages
659
Hello,

I am reorganizing a workbook containing 60 pivottables based on 7 pivotcaches.
I need to redefine the SourceData of these pivotcaches.
Would you know how to do that?

I have already seen that for pivottables this should be done like this:

pt.PivotTableWizard SourceType:=xlDatabase, SourceData:=srcd

However, I do not want to do this modification on a per-pivotable basis.
This is to make sure the number of pivotcaches does not increase during that process.
Keeping only a small number of pivotcaches is very useful for the performance of this workbook.

Any suggestion would be welcome.

Thanks,

Michel
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
38,772
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
See if this page helps.
 

lalbatros

Well-known Member
Joined
Sep 5, 2007
Messages
659
Thanks rorya.

Unfortunately it doesn't help.
I do not connect PTs to databases anymore, since long.
Instead, I download the source data, without even using any QT: I do it myself.
In this way I could improve performance and I am more in control.

Therefore, I am dealing with PT connected to excel ranges.
Today, I want to change the connection from an external workbook to the active workbook.
The active workbook contains the same data, and I want to connect all PT to these data using only the pivot caches.

This is a one-shot problem in the conversion job I am doing now.
Unfortunately, I don't not see other easy ways to do that, except than writing a short VBA sub.
But I found out I am not able to write this short VBA sub !

More suggestions?

Thanks,

Michel
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,484
Messages
5,831,933
Members
430,094
Latest member
soconfused365

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top