+ Reply to Thread
Results 1 to 5 of 5

Allow autofilter on protected sheet (via vba)

Hybrid View

MickeyGreen Allow autofilter on protected... 10-30-2007, 11:25 AM
MickeyGreen Anyone? Bueller? 10-30-2007, 12:24 PM
MickeyGreen SON of a... 10-30-2007, 12:28 PM
Leith Ross Hello MickeyGreen, You... 10-30-2007, 12:25 PM
MickeyGreen Poke poke you owe me a coke! 10-30-2007, 12:29 PM
  1. #1
    Registered User
    Join Date
    10-30-2007
    Posts
    51

    Allow autofilter on protected sheet (via vba)

    I'm trying to use the following code to allow the user to autofilter a protected sheet but it isn't working. Anyone know why?

    With Sheet1
           .Protect Password:="yyz", DrawingObjects:=True, Contents:=True, UserInterfaceOnly:=True, _
            AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
            AllowFiltering:=True
           .EnableOutlining = True
           .EnableAutoFilter = True
        End With

  2. #2
    Registered User
    Join Date
    10-30-2007
    Posts
    51
    Anyone?

    Bueller?

  3. #3
    Registered User
    Join Date
    10-30-2007
    Posts
    51
    SON of a B.....................................!

    FYI: It only works if you load the autofilter while the sheet is unprotected. But it then allows the user to select from the filter options.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello MickeyGreen,

    You will have to unprotect the sheet before you can use AutoFilter on it. AutoFilter will hide and unhide rows depending on the filteri outcome. These operations alter the Worksheet which is what protecting it prevents.

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    10-30-2007
    Posts
    51
    Quote Originally Posted by Leith Ross
    Hello MickeyGreen,

    You will have to unprotect the sheet before you can use AutoFilter on it. AutoFilter will hide and unhide rows depending on the filteri outcome. These operations alter the Worksheet which is what protecting it prevents.

    Sincerely,
    Leith Ross
    Poke poke you owe me a coke!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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