A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
If you want to allow editing objects with the first macro, then try this:
'Protecting worksheets
Sub protect_all_sheets()
top:
pass = InputBox("password?")
repass = InputBox("Verify Password")
If Not (pass = repass) Then
MsgBox "you made a mistake"
GoTo top
End If
For I = 1 To Worksheets.Count
If Worksheets(I).ProtectContents = True Then GoTo oops
Next
For Each s In ActiveWorkbook.Worksheets
s.Protect Password:=pass, Contents:=True, DrawingObjects:=False, UserInterfaceOnly:=True, AllowFormattingCells:=True
Next
Exit Sub
oops: MsgBox "I think you have some sheets that are already protected. Please unprotect all sheets then running this Macro."
End Sub