Hi all,
I have some code that is un-protecting each worksheet in my workbook, enabling outlining (to allow users the ability to use the group/un-group functionality) and then protecting the file again.
The issue, however, is that my protected sheets don't allow for the filters to be used.
Any suggestions on how I can modify the code to allow for this functionality to still take place? I'm happy to provide more details but my code is provided below.
Thanks in advance for any thoughts!
I have some code that is un-protecting each worksheet in my workbook, enabling outlining (to allow users the ability to use the group/un-group functionality) and then protecting the file again.
The issue, however, is that my protected sheets don't allow for the filters to be used.
Any suggestions on how I can modify the code to allow for this functionality to still take place? I'm happy to provide more details but my code is provided below.
Thanks in advance for any thoughts!
Code:
Private Sub Workbook_Open()
For Each wks In ThisWorkbook.Worksheets(Array( _
"Sheet1", "Sheet2"))
With wks
.Unprotect "password"
.EnableOutlining = True
.Protect "password", contents:=True, userInterfaceOnly:=True
End With
Next
End Sub