+ Reply to Thread
Results 1 to 4 of 4

Slicer select automatically

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    204

    Slicer select automatically

    Dear all,
    I want to select the slicer automatically with value = 0
    when the pivot table refresh, Someone who knows how to make this work?
    Thanks for your help / alternative solution ideas.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by kirana2014; 12-02-2020 at 04:41 PM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Slicer select automatically

    Please put this code in Sheet Pivot

    Dim t
    Private Sub Worksheet_PivotTableChangeSync(ByVal Target As PivotTable)
    If t <> PivotTables("PivotTable2").RefreshDate Then
        t = PivotTables("PivotTable2").RefreshDate
        Application.EnableEvents = False
        Dim it As SlicerItem
        For Each it In ActiveWorkbook.SlicerCaches("Slicer_Amount").SlicerItems
                it.Selected = it.Caption = "0"
        Next
    End If
    Application.EnableEvents = True
    End Sub
    
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        t = PivotTables("PivotTable2").RefreshDate
    End Sub
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    204

    Re: Slicer select automatically

    Dear Bo_Ry

    Is working

    Thank you

  4. #4
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    204

    Re: Slicer select automatically

    It's possible if on pivot table the value 0 not found clear the filter

    thank you

+ 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. Loop through slicer, while also selecting single slicer value on separate slicer
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2018, 01:41 PM
  2. A slicer to select different groupings?
    By mk3ll00 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-30-2018, 12:41 PM
  3. Replies: 1
    Last Post: 04-23-2018, 09:43 AM
  4. VBA to select certain names from a slicer.
    By Mr.Bigz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2018, 09:25 AM
  5. Slicer that will select a column
    By njw499 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-15-2016, 11:42 AM
  6. Newbie: Auto Select/un-Select an Range of Slicer Items
    By luckyali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 09:52 AM
  7. 'select all' option in slicer
    By Paul-NYS in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 12-24-2012, 09:23 AM

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