Results 1 to 5 of 5

Change Pivot Cache

Threaded View

karinos57 Change Pivot Cache 03-17-2009, 06:47 PM
Ron Coderre Re: Change Pivot Cache 03-17-2009, 07:44 PM
karinos57 Re: Change Pivot Cache 03-17-2009, 08:03 PM
karinos57 Re: Change Pivot Cache 03-18-2009, 10:38 AM
srkiran.k Re: Change Pivot Cache 01-24-2014, 05:18 AM
  1. #1
    Forum Contributor
    Join Date
    11-18-2007
    Posts
    111

    Change Pivot Cache

    In the past I have tried this but did not get help but I hope this time I get some kind of help because I am dying for help now. I have several pivot tables in my workbook with one data source. The data is extremely huge so I pulled the data from Access Database using EXTERNAL DATA SOURCE method in excel. So now I have my huge data in the pivot cache; what I would like to see is when user selects a Region from the pivot table, I want the user to be able to save the excel workbook with the Region he/she selected only. For instance, if the user selects East region, I want them to be able to save the whole workbook with East data only and exclude the rest. I have researched online and found some codes but could not figure out how to utilize it. I have attached small sample file for more details. Below is code I found on internet and it may be helpful to you. Thank in advance for your help
    link: http://www.contextures.com/xlPivot11.html

    Change the Pivot Cache
    
    'If you have created several pivot tables in a workbook, you may find it more 'fficient to use the same pivot cache for all the pivot tables. The following code will change the pivot cache for each pivot table in the workbook. 
    
    
    Sub ChangePivotCache()
    'change pivot cache for all pivot tables in workbook
    Dim pt As PivotTable
    Dim wks As Worksheet
    
      For Each wks In ActiveWorkbook.Worksheets
        For Each pt In wks.PivotTables
            pt.CacheIndex = Sheets("Pivot").PivotTables(1).CacheIndex
        Next pt
      Next wks
    
    End Sub
    Attached Files Attached Files

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