Results 1 to 4 of 4

Clear Pivot Slicers VBA

Threaded View

RunRabbit13 Clear Pivot Slicers VBA 11-05-2014, 01:12 PM
romperstomper Re: Clear Pivot Slicers VBA 11-05-2014, 01:58 PM
RunRabbit13 Re: Clear Pivot Slicers VBA 11-05-2014, 02:24 PM
RunRabbit13 Re: Clear Pivot Slicers VBA 11-17-2014, 11:38 AM
  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.



    'Show Prestige only
        
    If CheckBox1 = False And CheckBox2 = False And CheckBox3 = True Then
    AdrenalineCar.Visible = False
    DreamCar.Visible = False
    Both.Visible = False
    Prestige.Visible = True
    Dream_Prestige.Visible = False
    All3.Visible = False
    Adrenaline_Prestige.Visible = False
    
    With ActiveWorkbook.SlicerCaches("Slicer_Collection_Flag")
            .SlicerItems("ADRENALINE").Selected = False
            .SlicerItems("DREAM").Selected = False
        End With
    With ActiveWorkbook.SlicerCaches("Slicer_Collection_Flag1")
            .SlicerItems("ADRENALINE").Selected = False
            .SlicerItems("DREAM").Selected = False
            .SlicerItems("PRESTIGE").Selected = True
        End With
    With ActiveWorkbook.SlicerCaches("Slicer_Collection_Flag2")
            .SlicerItems("ADRENALINE").Selected = False
            .SlicerItems("DREAM").Selected = False
            .SlicerItems("PRESTIGE").Selected = True
        End With
    With ActiveWorkbook.SlicerCaches("Slicer_Collection_Flag3")
            .SlicerItems("ADRENALINE").Selected = False
            .SlicerItems("DREAM").Selected = False
        End With
        End If
    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.

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