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
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,397
Office Version
365, 2019, 2016, 2010
Platform
Windows, 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
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,439
Messages
5,511,368
Members
408,844
Latest member
Utican2

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top