Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unprotect worksheet when...... Wanna Learn Excel Discussion (Misc queries) 1 December 10th 08 01:14 PM
Unprotect Worksheet. xoom3 Excel Discussion (Misc queries) 4 July 14th 06 10:00 PM
Unprotect a worksheet FRAZZLED New Users to Excel 0 May 30th 06 05:06 PM
Unprotect worksheet via VBA Mike Echo Excel Worksheet Functions 2 March 19th 06 04:52 AM
unprotect worksheet Richard Sanchez Excel Programming 1 July 17th 04 01:26 AM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"