Macro to unfilter all slicer selections (de-select)

DLE1986

New Member
Joined
Feb 10, 2021
Messages
1
Can anyone help with the code I need to unfilter all the selections in my slicers on a workbook? I am looking to make all slicer selections NOT selected so the person using the workbook can start from scratch. Would love some help with how to do that via a macro, since excel currently only supports "clearing all filters" and not "unclearing/unfiltering". Thanks!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Welcome to the board!

Try something like
VBA Code:
Sub ClearSlicerSlections()

Dim SlC As SlicerCache

For Each SlC In ActiveWorkbook.SlicerCaches
    SlC.ClearAllFilters
Next SlC

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

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