Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to prompt for password to unprotect worksheets
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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to protect/unprotect with password | Excel Programming | |||
Password Applied to All Worksheets Confrimation Prompt | Excel Programming | |||
Password Applied to All Worksheets Confrimation Prompt | Excel Programming | |||
Protecting Multiple sheets with prompt for password to unprotect | Excel Programming | |||
unprotect more than one password in macro | Excel Programming |