Resetting all Slicers

UniMord

Active Member
Joined
May 6, 2002
Messages
311
I have 4 Slicers and would like to be able to reset them all at once.
Is there a button or setting that I'm overlooking? If not, how would I go about it in VBA?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Code:
Dim slcr As SlicerCache

    For Each slcr In ActiveWorkbook.SlicerCaches
    
        slcr.ClearManualFilter
    Next slcr
 
Upvote 0
Thank you. At the moment, I have just these 4 Slicers, so your code does the trick. However, it seems that if I were to have other Slicers elsewhere in the workbook, those would also get reset, not just these 4. How could I target just these 4?
 
Upvote 0
Code:
Dim slcr As SlicerCache

    For Each slcr In ActiveWorkbook.SlicerCaches
    
        slcr.ClearManualFilter
    Next slcr

Hi .. Is it possible to amend the code so that it clears all the filters from Slicer but keeps the Blanks away?
 
Upvote 0
I know this post is old but I just had this situation and applied this solution:

Code:
'***Clear all slicers on activesheet except named***
Sub clearslcr()
Dim slcr As SlicerCache
Dim sl As Slicer


    For Each slcr In ActiveWorkbook.SlicerCaches
    For Each sl In slcr.Slicers
    If sl.Parent.Name = ActiveSheet.Name Then
    
If InStr(sl.Name, "FILTER DATE") = False Then


        slcr.ClearManualFilter
End If
End If
Next sl
    Next slcr
End Sub
 
Upvote 0
Unimord, I know this post is very old but I will still pass along how to clear slicer filters, which I found on my own by accident.
Select all slicers using CTRL+Click
Select Data Tab, sort and filter section
Select clear

You won't need VBA code.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,216,136
Messages
6,129,080
Members
449,485
Latest member
greggy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top