Results 1 to 2 of 2

Protect sheet but enable auto filter drop down selection

This is a discussion on Protect sheet but enable auto filter drop down selection within the Excel Questions forums, part of the Question Forums category; Hello, I want protect a worksheet so a user cannot change the content of any cells. However, I would like ...

  1. #1
    New Member
    Join Date
    Jan 2004
    Posts
    7

    Default Protect sheet but enable auto filter drop down selection

    Hello,

    I want protect a worksheet so a user cannot change the content of any cells. However, I would like the user to be able to use the autofilter that I have put on each column heading.

    I'm using Excel 2000 SR-1

    I'm a beginner when it comes to programming.

    Many thanks,

    Hassesbar

  2. #2
    New Member
    Join Date
    Oct 2002
    Location
    Art Farrell
    Posts
    11

    Default Protect sheet but enable auto filter drop down selection

    Since you're not familiar with macros do the following:

    1- Hit ALT-F11 to get to the VBE
    2- In the VBE hit CTRL-R to view the Project Explorer
    3- Find your workbook. It should look like:
    VBAProject (yourfilename.xls)*
    4- Click the + sign to open the file. Double-click on the item
    named "ThisWorkbook" to open the module sheet.
    5- Copy the following macro and paste it in this sheet:

    Private Sub Workbook_Open()
    With ActiveSheet
    .EnableAutoFilter = True
    .Protect DrawingObjects:=True, contents:=True, _
    Scenarios:=True, UserInterfaceOnly:=True
    End With
    End Sub

    Now you can hit ALT-F11 to return to Excel. Select the sheet that has your Autofilter and close the workbook.
    When you reopen the workbook the Autofilter sheet will be protected but you will be able to use the Autofilter.

    CHORDially,
    Art Farrell

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com