Protect and Filter

  • Thread starter Thread starter gilbert
  • Start date Start date
G

gilbert

Hi,

Just wonder how we can allow the user to use filter function when
have protect the worksheet for the worksheet contained formulas.

I know this can be done using Office 2003, but can we do the same usin
older version of Office since not everyone so rich to upgrade thei
office to the latest version.

Please give some thoughts on this.

Thank you.

Rgds,
Gilber
 
Thanks Paul B, but I am not very sure of how to customize the code
since I have not programming knowledge at all. As such, would highl
appreciate your help me defining how to customize the code for m
workbook.

Basically, these are some of the info on my workbook

Workbook name : Joblist.xls
Protection password : 3223454

Private Sub Workbook_Open()
'check for filter, turn on if none exists
With Worksheets("Data")
If Not .AutoFilterMode Then
.Range("A1").AutoFilter
End If
.EnableAutoFilter = True
.Protect Password:="password", _
Contents:=True, UserInterfaceOnly:=True
End With
End Sub

How should I customize it? Please share your expertise.

Thank you.


Rgds,
Gilber
 
Gilbert, try this,

To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is to the left of the "File" menu this will open
the VBA editor, in the left hand window double click on thisworkbook, under
your workbook name, and paste the code in the window that opens on the right
hand side, press Alt and Q to close this window and go back to your
workbook, now this will run every time you open the workbook. If you are
using excel 2000 or newer you may have to change the macro security
settings to get the macro to run. Change "Data" to your worksheet name

Private Sub Workbook_Open()
'check for filter, turn on if none exists

'****Put your worksheet name where Data is at****
With Worksheets("Data")

If Not .AutoFilterMode Then
.Range("A1").AutoFilter
End If
.EnableAutoFilter = True
.Protect Password:="3223454", _
Contents:=True, UserInterfaceOnly:=True
End With
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
Back
Top