I have been using the following code to protect all worksheets in a workbook:
This password protects all sheets without exceptions.Code:Public Sub ProtectAll()
Const PWORD As String = "mysecretword"
Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
wsSheet.Protect Password:=PWORD
Next wsSheet
End Sub
Is there any way to modify the code so that, while it protects all sheets, it universally allows editing of objects, autofilter, and Pivot reports?