+ Reply to Thread
Results 1 to 4 of 4

Clear Pivot Slicers VBA

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Florida, U.S.
    MS-Off Ver
    2010
    Posts
    20

    Clear Pivot Slicers VBA

    I am trying to clear slicers completely with my code. I have a userform that allows the user to choose their data cut. The slicers are coming from two different data sources .. one with three options and one with two. In order to maintain accuracy when users select the slicers that don't have the option from the other slicer I want the slicer to be completely unselected. Please forgive my amateur code below. I have been piecemealing this together for quiet awhile relying heavily on macro recorder.

    "Slicer_Collection_Flag" will end up being blank but "Slicer_Collection_Flag3" does not. Any suggestion are appreciated.



    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-10-2016 at 05:42 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Clear Pivot Slicers VBA

    You can't have no items selected in a slicer but to clear existing filters you can simply use:
    Please Login or Register  to view this content.
    for example.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Florida, U.S.
    MS-Off Ver
    2010
    Posts
    20

    Re: Clear Pivot Slicers VBA

    Thank you for the reply. I have attached an image showing that one of my filters actually does completely clear with my code. How is this possible?


    Capture.PNG

  4. #4
    Registered User
    Join Date
    08-27-2014
    Location
    Florida, U.S.
    MS-Off Ver
    2010
    Posts
    20

    Re: Clear Pivot Slicers VBA

    If anyone reads this thread romperstomper was correct with his reply. I have "blanks" not showing in the first collection flag that were being selected when I coded the filters to not select either filter. A dirty workaround to make your filters completely unselected is to add blank data and hide the visibility of it in the slicer

+ 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. Sync pivot slicers from different database by vba
    By carrieliu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-06-2013, 04:47 AM
  2. Can you have pivot table fields as slicers?
    By no.18shirt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2013, 05:12 PM
  3. RESOLVED: Working with Slicers - Pivot charts
    By uimhirADo in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-29-2013, 04:13 PM
  4. Can you have pivot table fields as slicers?
    By no.18shirt in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-19-2013, 10:39 AM
  5. Replies: 2
    Last Post: 05-24-2013, 03:58 PM

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