Specify which slicers are reset

TJDetweiler

New member
Joined
Feb 21, 2019
Messages
2
Reaction score
0
Points
0
Excel Version(s)
2010, 2013, 2016, 365
I have inherited a 2010 workbook that I have been told needs to stay in this version, as well as add a 5[SUP]th[/SUP] slicer ( YAY! ). What I initially looked for was to exclude it from being reset when the user selects the clear filters button. The code currently being used, which I have seen on other posts is a general all clear,

Sub ClearMySlicers()
Dim Slcr As SlicerCache
For Each Slcr In ActiveWorkbook.SlicerCaches
Slcr.ClearManualFilter
Next
End Sub


I have also seen where the specific slicers are being called out in the code and put something like this together,

Sub ClearMySlicers()

ActiveWorkbook.SlicerCaches("Slicer_SlicerName01").ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_SlicerName03").ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_SlicerName04").ClearManualFilter

End Sub


to test the functionality, but the debugger would always stop at the first ActiveWorkbook line and couldn't get it to work.

If someone could let me know how gar off I am with this line of thought would be appreciated.

Thanks in advance for the help.
 
p45cal,

Yeah, it read Invalid procedure call or argument error, but figured out what was causing it.

Regardless, this post can be deemed closed.

Thank you.
 
Hi and welcome
Please,do not crosspost your question on multiple forums without including links here to the other threads on other forums.

Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question
 
Back
Top