Hi,
I have created a macro that will autoprotect and sutosave a sheet when closing with a specific password.
How I need to allow people who do not know the password to filter on the sheet.
what code do I need to add to allow filtering without being able to unprotect the sheet?
Code I currently have:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect "Password"
Next ws
ThisWorkbook.Protect "Password", True
ThisWorkbook.Save
End Sub
Thanks
Stevie
I have created a macro that will autoprotect and sutosave a sheet when closing with a specific password.
How I need to allow people who do not know the password to filter on the sheet.
what code do I need to add to allow filtering without being able to unprotect the sheet?
Code I currently have:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect "Password"
Next ws
ThisWorkbook.Protect "Password", True
ThisWorkbook.Save
End Sub
Thanks
Stevie