+ Reply to Thread
Results 1 to 8 of 8

Error on macro to clear filters

  1. #1
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Winterville, NC
    MS-Off Ver
    Excel 2013
    Posts
    141

    Error on macro to clear filters

    I have a workbook I can not share due to HIPPA protected information. I'm using Excel 2013. Here is a breakdown:

    Summary tab (sheet 1)
    contains slicers and a summary table
    slicers pull from formatted table on Falls tab (sheet 2)

    People can change slicers as they see fit. They may go to the Falls sheet and they may turn on additional filters on that table.

    I have a button on the Summary sheet that I want them to be able to reset all the slicers on the Summary sheet and the filters on the Falls sheet. Here is the code.

    Please Login or Register  to view this content.
    I am getting an error if no additional filters were turned on for the FAlls sheet. The error is: "Run-time error '1004': ShowAllData method of Worksheet class failed." How can I avoid this error?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Error on macro to clear filters

    There's a bug in Excel which means you can't access or amend the Visible property for Row Fields (possibly Column fields) which are of Data datatype (and Date formatted).


    http://www.mrexcel.com/forum/excel-q...vot-table.html
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Winterville, NC
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Error on macro to clear filters

    Good info!

    But do you really think it's that? After reading through that thread, the difference I see is my code (haha...I mean the code I got from that other guy) works as long as there are filters turned on for my table. It only throws the debug error if there are no filters turned on.

    I was wondering if I just do some type of "If" it may work without the debugging error?

    I'm just questioning because the errors on that other thread weren't the same errors I'm getting.

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Error on macro to clear filters

    Right I just suggested that because it was an issue for me once and you didn't post a sample workbook for me to evaluate.

    If you are only throwing a code, why not evaluate if there is a filter first, and THEN clear it?

  5. #5
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Winterville, NC
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Error on macro to clear filters

    Sorry for no sample...I know that makes it harder!

    If you are only throwing a code, why not evaluate if there is a filter first, and THEN clear it?
    YESSSS! That's what I don't know how to do but want to figure out!!! Or...I mean...have someone on here tell me!!!!!

  6. #6
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Error on macro to clear filters

    You can try the following.
    http://stackoverflow.com/questions/1...l-are-selected


    Also, most people MAKE a sample that is representative of the work. In the past I have replaced all the sensitive info with random names and numbers to at this point it is only the structure that remains, OR I have made a simple example that is representative of the issue at hand.

  7. #7
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Error on macro to clear filters

    I would implement something like this I think:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Winterville, NC
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Error on macro to clear filters

    Thanks for all of your ideas and input. I ended up using this:

    Please Login or Register  to view this content.
    From: http://stackoverflow.com/questions/1...t-class-failed

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Button to clear filters
    By EdwardStephenson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2014, 05:14 AM
  2. Clear all filters
    By crs245 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2013, 06:58 AM
  3. Macro to clear all filters in a table
    By quantumag in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-07-2013, 05:39 PM
  4. Print Macro / module error & Update / Clear Macro error
    By mal.b.graham in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-28-2012, 06:40 PM
  5. Clear all filters from table
    By Jaymond Flurrie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2008, 02:31 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1