S
Sarah (OGI)
I've got the following vb code in an Excel macro to unprotect all worksheets
in a document:
Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Worksheets.Count
Worksheets(n).Unprotect Password:="password"
Next n
Application.ScreenUpdating = True
End Sub
The code is attached to a command button on the first worksheet. When the
button is selected, I'd like a prompt to appear to ask the user to input the
relevant password. If the password entered does not match what has been
specified in the code, the sheets cannot be unprotected. How can I do this?
Also, is there any way of disabling the sheet protection option on the menu
bar: Tools\Protection\Unprotect Sheet?
Many thanks in advance.
in a document:
Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Worksheets.Count
Worksheets(n).Unprotect Password:="password"
Next n
Application.ScreenUpdating = True
End Sub
The code is attached to a command button on the first worksheet. When the
button is selected, I'd like a prompt to appear to ask the user to input the
relevant password. If the password entered does not match what has been
specified in the code, the sheets cannot be unprotected. How can I do this?
Also, is there any way of disabling the sheet protection option on the menu
bar: Tools\Protection\Unprotect Sheet?
Many thanks in advance.