+ Reply to Thread
Results 1 to 3 of 3

Refresh Pivot Table w/VBA upon Slicer Selection Change

  1. #1
    Registered User
    Join Date
    03-26-2019
    Location
    Dallas, TX
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Refresh Pivot Table w/VBA upon Slicer Selection Change

    To start with, I have a fair amount of experience in Excel, but very little to no experience with macros/VBA

    Essentially, I have an excel workbook that has a pivot table connected to a data source that has lookups/matchbacks based on a separate pivot table that's controlled by a slicer. Essentially, I need to set up a VBA code that will update the particular pivot table that’s connected to the data source when my slicer updates the pivot table that adjusts the lookups/matchbacks in the data source. For additional context, the slicer controls a separate pivot table that changes the values displayed by the cells in my data source, but it does not actually change the contents of the cells. The pivot table I need to have updated displays a percentage based on whether the cells in my data source display a "1" or a "0". As it currently sits, I have to refresh the data every time the slicer is changed, and I’d like to have it update automatically every time I change the slicer.

    I have searched up and down the internet for a solution, but everything I find shows a code for updating a pivot table when the data source has values that actually change, but not references that just change what the cells display.

    Any help is appreciated

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,910

    Re: Refresh Pivot Table w/VBA upon Slicer Selection Change

    The slicer changes the value of a pivot table. You should be able to use one of the change events for pivot tables to kick off code to refresh the other pivot tables. That is about as far as I can take it without seeing how the workbook is laid out.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    03-26-2019
    Location
    Dallas, TX
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Refresh Pivot Table w/VBA upon Slicer Selection Change

    I've uploaded the file as a binary excel file for size reasons (1.6 mb for macro-enabled).
    The "Delay Code" slicer is connected to the "CarrierShipmentDetail" and "MatchbackSummary" pivot tables, but not the "CarrierOnTimePercentage" pivot table. The "CarrierOnTimePercentage" pivot table is sourced directly from the "OnTimeData" sheet, particularly columns AB through AF for the on time percentage figures (with calculated fields). The "Delay Code" slicer controls the "MatchbackSummary" pivot table that column AF in the OnTimeData sheet is referenced to. My problem is, I have to refresh the worksheet data every time I change the slicer selections in order to update the "CarrierOnTimePercentage" pivot table. I'd like the "CarrierOnTimePercentage" pivot table to update automatically every time the "Delay Code" slicer is changed.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Refresh Pivot Data based on slicer selection
    By skate1991 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2017, 11:59 AM
  2. Autofilter last 13 months in PIVOT TABLE upon Slicer Selection
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2017, 03:14 PM
  3. Change Pivot Table Column field on Slicer selection (Excel 2013)
    By kevboyo in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-27-2014, 11:36 PM
  4. Limiting a pivot table slicer to one selection
    By behrensf84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 09:25 PM
  5. pivot table selection and refresh issue
    By mdqadirmohiuddin in forum Excel General
    Replies: 0
    Last Post: 11-08-2012, 10:33 PM
  6. [SOLVED] Using VBA to change a pivot table filter, refresh the report and set up a refresh delay
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-18-2012, 10:43 AM
  7. Replies: 2
    Last Post: 02-23-2005, 08:06 AM

Tags for this Thread

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