Thread: excel filter
View Single Post
  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

If all your users are using xl2002+, you can protect the worksheet and allow the
autofilter to work (autofilter arrows are already applied).

It's an option near the bottom on the protect sheet dialog.

If any of your users are using xl2k or below, then you need a macro:

Use this in the Auto_open procedure in a General module:

Option Explicit
Sub auto_open()

Dim wks As Worksheet
Set wks = Worksheets("sheet1")

With wks
.Protect Password:="hi", userinterfaceonly:=True
.EnableAutoFilter = True
End With

End Sub

(you could use the workbook_open event under ThisWorkbook, too.)

This setting isn't remembered between closing/reopening the workbook. (So
Auto_open is a nice spot for it.)

Pedro wrote:

hi! I was trying to put a filter in a protected sheet in my workbook (Excel
2003)
It doesn't work. is there a way to put it working or it doesn't work at all?
thanks


--

Dave Peterson