+ Reply to Thread
Results 1 to 5 of 5

Issue with Removing Pivot Tables from Slicers via VBA

  1. #1
    Registered User
    Join Date
    09-19-2008
    Location
    Gloucester, MA
    MS-Off Ver
    Excel 2016
    Posts
    62

    Issue with Removing Pivot Tables from Slicers via VBA

    I created a Dashboard that includes a few slicers connected to a number of pivot tables. When I update the source data, I run code that will remove the slicers so that I can refresh the pivot tables. Then I try to reconnect the pivot tables to the slicers. The issue I have is that the slicer connections are totally removed and not just unchecked, so the section of code that reconnects the slicers back to the pivot tables causes an error because there are no pivot tables in the list to connect to. Is there something I'm doing wrong in the code that is totally removing the pivot tables and not just unchecking them? Thanks for your help.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Issue with Removing Pivot Tables from Slicers via VBA

    1. Instead of storing PivotTable object in the array, store PivotTable.Name

    2. Then you can use it like...
    Please Login or Register  to view this content.
    However, I'm not sure why you need to remove slicers? It's easier to just set dynamic range for PivotTable Data source.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    09-19-2008
    Location
    Gloucester, MA
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Issue with Removing Pivot Tables from Slicers via VBA

    If it makes more sense to set a dynamic range for the data source, I'd love to try that. How do I set a dynamic range for the PivotTable data source? Thanks.

  4. #4
    Registered User
    Join Date
    09-19-2008
    Location
    Gloucester, MA
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Issue with Removing Pivot Tables from Slicers via VBA

    Setting a dynamic range for the PivotTable data source worked great! Don't have to run all that code! Thanks.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Issue with Removing Pivot Tables from Slicers via VBA

    You are welcome. Sorry couldn't check forum earlier. Glad you got it solved.

+ 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. Pivot Tables and Slicers
    By MarBoTJ in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2018, 03:10 PM
  2. slicers on copied pivot tables
    By stephme55 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-07-2016, 02:07 PM
  3. slicers for sorting pivot tables
    By stephme55 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-11-2016, 03:49 PM
  4. slicers for sorting pivot tables
    By stephme55 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-07-2016, 03:38 PM
  5. I want to synchronize slicers from several pivot tables
    By flore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2015, 08:33 PM
  6. Pivot tables/slicers
    By Kittykatinla in forum Excel General
    Replies: 0
    Last Post: 11-06-2014, 02:21 AM
  7. Replies: 9
    Last Post: 02-24-2014, 06:12 PM

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