+ Reply to Thread
Results 1 to 3 of 3

Consolidate existing Pivot Tables to use one cache

  1. #1
    Forum Contributor
    Join Date
    04-14-2008
    Location
    Fort Collins, Co
    MS-Off Ver
    2016
    Posts
    107

    Exclamation Consolidate existing Pivot Tables to use one cache

    All my pivots use the same exact data source. I tried to be good about copying and pasting pivots, but I'm afraid some pivots were not created that way.

    I found this code on the web:

    Please Login or Register  to view this content.
    But this does not work. I'm using the sheet ALLRATES (has two pivot tables PivotTable1 and PivotTable2). I just want to make every pivot in my workbook use the same cache as PivotTable1 in the ALLRATES worksheet.
    Last edited by 4am; 02-18-2011 at 01:28 PM.
    Is That Your Spreadsheet Or Did Your Database Just Throw Up?


  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidate existing Pivot Tables to use one cache

    I have not tested it but try this:
    Please Login or Register  to view this content.
    That should make all pivots on the sheet ALLRATES to use pivot 1 cache

  3. #3
    Forum Contributor
    Join Date
    04-14-2008
    Location
    Fort Collins, Co
    MS-Off Ver
    2016
    Posts
    107

    Re: Consolidate existing Pivot Tables to use one cache

    I had only 2 pivot caches in my workbook, but this code shaved 20MB off my data.

    Open your workbook,
    Save a copy (just in case something goes wrong)
    Press ALT+F11
    Double-click Module 1
    Copy and paste code below
    Replace the (“Glembo”) in: Set ptO = wb.Sheets("Glembo").PivotTables(1) with the name of a worksheet that has ONLY ONE PIVOT Table in it
    Run macro ‘ConsolidatePivotCache’

    This will tell you first how many pivot caches you currently have
    Then the macro runs after you click ok
    Then it will tell you how many pivot caches you have after running the macro
    Then, all pivot tables will refresh.

    Save file – watch the megabytes disappear!

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1