Results 1 to 4 of 4

Thread: Specify which slicers are reset

  1. #1
    Neophyte TJDetweiler's Avatar
    Join Date
    Feb 2019
    Posts
    2
    Articles
    0
    Excel Version
    2010, 2013, 2016, 365

    Specify which slicers are reset



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I have inherited a 2010 workbook that I have been told needs to stay in this version, as well as add a 5th 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.

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,708
    Articles
    0
    Excel Version
    365
    Quote Originally Posted by TJDetweiler View Post
    but the debugger would always stop at the first ActiveWorkbook line and couldn't get it to work.
    …and the error message was?

  3. #3
    Neophyte TJDetweiler's Avatar
    Join Date
    Feb 2019
    Posts
    2
    Articles
    0
    Excel Version
    2010, 2013, 2016, 365
    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.

  4. #4
    Administrator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,706
    Articles
    0
    Excel Version
    2010 on Xubuntu
    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
    Thank you Ken for this secure forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •