Thanks for assistance!! I followed instruction but got message "Compile Error: Ambiguous name detected: Workbook_BeforeClose
Spreadsheet is already macro enabled with
Sub ProtectALLShts()
Dim Pwd
Pwd = "Clyde123"
For Each ws In Sheets
If ws.ProtectContents = False Then
ws.Protect Password:=Pwd
End If
Next
ActiveWorkbook.Save
End Sub
as well as
Sub UnProtectAll()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to unprotect all worksheets", "Password Input")
On Error Resume Next
For Each wSheet In Worksheets
wSheet.Unprotect Password:=Pwd
Next wSheet
If Err <> 0 Then
MsgBox "You have entered an incorrect password. All worksheets could not " & _
"be unprotected.", vbCritical, "Incorrect Password"
End If
On Error GoTo 0
End Sub
Perhaps this is confusing the issue?
Thanks/Dankie Winon
Bookmarks