Hi all,
I'm using the code below to lock and unlock all sheets in a workbook. I require users to use slicers and/or filter data in tables within the sheets. I have removed protection from the slicers, but I can't figure out how to allow the autofilter for all sheets when protecting all sheets at once. Any help would be great. Thanks.
------------------------------------------------------------------------------------
' Protect All Worksheets
Sub ProtectAllSheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect "Password"
Next ws
End Sub
--------------------------------------------------------------------------------------
' UnProtect All Worksheets
Sub UnProtectAllSheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect "Password"
Next ws
End Sub
-----------------------------------------------------------------------------------------
I'm using the code below to lock and unlock all sheets in a workbook. I require users to use slicers and/or filter data in tables within the sheets. I have removed protection from the slicers, but I can't figure out how to allow the autofilter for all sheets when protecting all sheets at once. Any help would be great. Thanks.
------------------------------------------------------------------------------------
' Protect All Worksheets
Sub ProtectAllSheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect "Password"
Next ws
End Sub
--------------------------------------------------------------------------------------
' UnProtect All Worksheets
Sub UnProtectAllSheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect "Password"
Next ws
End Sub
-----------------------------------------------------------------------------------------