Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Password Protect - put password in a cell in the workbook
Hi - I have some VB code that runs throughout my workbook and it does a lot
of protecting/un protecting of sheets. I have hard-coded the password into the vb code. I am fearful that if I need to change the password, I will not change it everywhere. I would like to instead put the password on my data sheet and then have the vb code refer to cell A1 on sheet1 to get the password. Is this possible? Thanks, Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Password Protect - put password in a cell in the workbook
Hi Mike,
You can do this: Sub password() dim Pass as string Pass = InputBox("Password:", "type your password!") Sheet1.[a1].value = Pass Activesheet.Protect Pass End Sub Rgds, Halim Mike R. menuliskan: Hi - I have some VB code that runs throughout my workbook and it does a lot of protecting/un protecting of sheets. I have hard-coded the password into the vb code. I am fearful that if I need to change the password, I will not change it everywhere. I would like to instead put the password on my data sheet and then have the vb code refer to cell A1 on sheet1 to get the password. Is this possible? Thanks, Mike |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Password Protect - put password in a cell in the workbook
Worked perfect. Thanks
" wrote: Hi Mike, You can do this: Sub password() dim Pass as string Pass = InputBox("Password:", "type your password!") Sheet1.[a1].value = Pass Activesheet.Protect Pass End Sub Rgds, Halim Mike R. menuliskan: Hi - I have some VB code that runs throughout my workbook and it does a lot of protecting/un protecting of sheets. I have hard-coded the password into the vb code. I am fearful that if I need to change the password, I will not change it everywhere. I would like to instead put the password on my data sheet and then have the vb code refer to cell A1 on sheet1 to get the password. Is this possible? Thanks, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I password protect an excel workbook? | Excel Discussion (Misc queries) | |||
XL2007 - password protect workbook? | Excel Discussion (Misc queries) | |||
Password Protect a Workbook ? | New Users to Excel | |||
password protect workbook | Excel Discussion (Misc queries) | |||
password protect on workbook | Excel Programming |