Excel 2016 Slicer - select all except 1

2k views Asked by At

I have a slicer that contains 340 filters. I would like to exclude 1 item. How can I do this without having to manually select the other 339?

I would like to be able to toggle between including all items ie switching the filter off completely and including all items except the item AB12345

2

There are 2 answers

0
vknowles On BEST ANSWER

Maybe I'm misunderstanding the question, but I think you can do what you want by using CTRL+click on the item you don't want to see.

I deselected one item using CTRL+click

1
Parfait On

Consider iterating through all SlicerItems of specific SlicerCache in VBA and conditionally set the specific item to be .Selected as False using .Caption property (assumed below as AB12345):

Sub SelectSpecificItem()

    Dim slcCache As SlicerCache
    Dim index As Integer

    Set slcCache = ThisWorkbook.SlicerCaches("SlicerName")  ' OR USE SLICER INDEX NUMBER

    With slcCache

        For index = 1 To .SlicerItems.Count            
            If .SlicerItems(index).Caption = "AB12345" Then                    
                .SlicerItems(index).Selected = False
            Else
                .SlicerItems(index).Selected = True    
            End If
        Next index

    End With

End Sub