+ Reply to Thread
Results 1 to 3 of 3

Button to clear filters

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Button to clear filters

    Hello

    I have a protected worksheet (with a password) in a shared workbook - thus the sort & filter icon on the home tab is greyed out and unusable. This makes clearing all filters a real chore because you have to look across the columns and take off the filters one by one.

    I tried recording a macro and assiging it to a button which cleared the filters but I get the run-time error '1004: ShowAllData method of Worksheet class failed. I assumed this was because of the protection on, so I recorded a macro which took the protection off, cleared the filters and then put the protection back on (all with a password). However, this gives me the 1004 error again with the Unprotect method failing...


    Is it possible for a macro to be assigned to a button that enters the password to unprotect the worksheet, clears all filters, then protects it again with the password.

    Does anyone know if this is even possible? Any help would be massively appreciated.

    Thanks guys

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Button to clear filters

    Paste the below code under that button and try it
    Please Login or Register  to view this content.
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Button to clear filters

    You may not change protection in a shared workbook.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

+ 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. Clear all filters
    By crs245 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2013, 06:58 AM
  2. [SOLVED] Clear button, add warning dialogue box that asks: Are you sure you want to clear?
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2012, 02:41 PM
  3. Button to clear sheet and automatic clear rows
    By sandbach in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-29-2010, 02:06 PM
  4. Clear Filters on Exit
    By beegeeblueboy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2010, 04:29 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

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