Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Protect Sheet but enable Autofilter (Excel 2002)

    Hi

    I am trying to protect a sheet called CustomerPriceList but still allow autofilter, is this possible, my feeble attempt is listed below

    Many Thans

    Braddy

    Sub CustListSort()

    ' CustListSort Macro
    ' Macro recorded 11/07/2005 by Alan Bradshaw


    Sheets("CustomerPriceList").Protect

    Selection.AutoFilter Field:=1, Criteria1:="<>"

    CustomerPriceList.EnableAutoFilter = True

    End Sub
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Protect Sheet but enable Autofilter (Excel 2002)

    One possibility is to turn on AutoFilter before protecting the sheet. You must also specify that filtering is allowed when protecting the sheet:

    Range("A1").AutoFilter
    ActiveSheet.Protect AllowFiltering:=True

    If you want to turn on AutoFilter after protecting, you must also specify that you can still modify the worksheet through macros:

    ActiveSheet.Protect AllowFiltering:=True, UserInterfaceOnly:=True
    Range("A1").AutoFilter

    I have assumed that the table to be filtered starts in cell A1.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Protect Sheet but enable Autofilter (Excel 2002)

    Hi Hans

    Guess what Thanks again.

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

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