AutoFilter on a protected worksheet

A

ADK

I have two worksheets which I have defined the columns with AutoFilter. I
have the sheets protected. When a user opens the sheet they can use those
predefined filters. I currently have the following code in WorkBook_Open. Is
this code even required ...if so is what I have correct?

Occasionally, the AutoFilter pull-downs stop working for some reason.
Current fix is to exit workbook and re-open it ....Auto-filters are fine

Using Excel 2000


Private Sub Workbook_Open()
On Error GoTo addError
With Worksheets("PDSR")
If Not .AutoFilterMode Then
.Unprotect Password:="12345"
.Range("A6:D6").AutoFilter
End If
.EnableAutoFilter = True
.Protect Password:="12345", _
Contents:=True, UserInterfaceOnly:=True
End With
With Worksheets("CompletionTable")
If Not .AutoFilterMode Then
.Unprotect Password:="12345"
.Range("C6:I6").AutoFilter
End If
.EnableAutoFilter = True
.Protect Password:="12345", _
Contents:=True, UserInterfaceOnly:=True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top