Hello,
I am attempting to lock all of the tabs of a worksheet with certain setting allowed (insert rows, delet rows, sort, use autofilter, edit objects, select locked cells, select unlocked cells format columns). I found the following vba on the internet but am unsure of how to make it only allow the above actions.
Sub ProtectAll()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
For Each wSheet In Worksheets
wSheet.Protect Password:=Pwd, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowFormattingColumns:=True, AllowFormattingRows:=True
Next wSheet
End Sub
Any help is appreciated:
my guess is to add
Allowselectlockedcells=true, alloweditobject=true, etc but some of the commands don't seem to be working.
I am attempting to lock all of the tabs of a worksheet with certain setting allowed (insert rows, delet rows, sort, use autofilter, edit objects, select locked cells, select unlocked cells format columns). I found the following vba on the internet but am unsure of how to make it only allow the above actions.
Sub ProtectAll()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
For Each wSheet In Worksheets
wSheet.Protect Password:=Pwd, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowFormattingColumns:=True, AllowFormattingRows:=True
Next wSheet
End Sub
Any help is appreciated:
my guess is to add
Allowselectlockedcells=true, alloweditobject=true, etc but some of the commands don't seem to be working.