+ Reply to Thread
Results 1 to 4 of 4

Protected filter range error

  1. #1
    Forum Contributor
    Join Date
    01-21-2017
    Location
    England
    MS-Off Ver
    2007
    Posts
    409

    Protected filter range error

    Hi I have the following vba code:

    Please Login or Register  to view this content.
    I want to protect the sheet so I've un-ticked locked on the filter cell. I've also enabled allow "sort" and use autofilter in the protect settings but it keeps flagging this code as an error. It works fine If I don't protect the sheet.

    Cheers

    Dave
    Last edited by AliGW; 01-08-2019 at 05:54 AM. Reason: Moved to appropriate forum section.

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Protected filter range error

    When you protect the sheet use the switch: userinterfaceonly = True

    eg

    Please Login or Register  to view this content.
    This tells VBA to allow code to make changes to cells but prevent users from doing so.

    NB: Excel will 'forget' that you've used this switch every time you open the workbook, therefore, you're going to need to add some code to the workbook_open event to remind it. To do this, simply unprotect and re-protect every sheet you need to be able to allow VBA to make changes when protected.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-21-2017
    Location
    England
    MS-Off Ver
    2007
    Posts
    409

    Re: Protected filter range error

    Many thanks for that

  4. #4
    Forum Contributor
    Join Date
    01-21-2017
    Location
    England
    MS-Off Ver
    2007
    Posts
    409

    Re: Protected filter range error

    Hi I'm having an issue where I put the password into unprotect the sheet but it's not being recognized.

+ 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. error code 1001: paste special Method range class failed on protected sheets
    By Ity007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-02-2016, 09:15 PM
  2. [SOLVED] Advanced filter returning all dates instead of those in criteria range, or error
    By nemmy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-03-2016, 02:45 PM
  3. Filter pivot table based on named range - Error 1004
    By Upset in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2015, 05:42 AM
  4. Copy Filter Range to new worksheet error
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2012, 10:05 PM
  5. Advance Filter Project - OUT of range error
    By Ssam87 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-15-2012, 06:24 PM
  6. Auto Filter Method in Range failed - error
    By BorisMKD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2009, 05:24 AM
  7. Sort and filter range with protected cells
    By jman0707 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2008, 12:40 PM

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