Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using an Input Box to Unprotect a Worksheet
I have what is probably an easy question but I cannot seem to come up with a
solution. I have a worksheet that I am protecting various columns with a password. On the worksheet I have a button with a macro attached to it. I would like to have an InputBox appear requesting a password that will unprotect the worksheet when the button is clicked. All help is greatly appreciated. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using an Input Box to Unprotect a Worksheet
Pablo,
This utilises an inputbox so there is no password mask and it can be read by anyone looking. You can have a masked input box but that is more complicated or you can use a userform to look like an input box and have a password mask in that Sub Button1_Click() response = InputBox("Enter Password") On Error GoTo GetMeOut ActiveSheet.Unprotect Password:=response 'your code Exit Sub GetMeOut: MsgBox "Incorrect password supplied" End Sub Mike "Pablo" wrote: I have what is probably an easy question but I cannot seem to come up with a solution. I have a worksheet that I am protecting various columns with a password. On the worksheet I have a button with a macro attached to it. I would like to have an InputBox appear requesting a password that will unprotect the worksheet when the button is clicked. All help is greatly appreciated. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using an Input Box to Unprotect a Worksheet
Thank you very much.
"Mike H" wrote: Pablo, This utilises an inputbox so there is no password mask and it can be read by anyone looking. You can have a masked input box but that is more complicated or you can use a userform to look like an input box and have a password mask in that Sub Button1_Click() response = InputBox("Enter Password") On Error GoTo GetMeOut ActiveSheet.Unprotect Password:=response 'your code Exit Sub GetMeOut: MsgBox "Incorrect password supplied" End Sub Mike "Pablo" wrote: I have what is probably an easy question but I cannot seem to come up with a solution. I have a worksheet that I am protecting various columns with a password. On the worksheet I have a button with a macro attached to it. I would like to have an InputBox appear requesting a password that will unprotect the worksheet when the button is clicked. All help is greatly appreciated. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
unprotect worksheet when...... | Excel Discussion (Misc queries) | |||
Unprotect Worksheet. | Excel Discussion (Misc queries) | |||
Unprotect a worksheet | New Users to Excel | |||
Unprotect worksheet via VBA | Excel Worksheet Functions | |||
unprotect worksheet | Excel Programming |