Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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
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
How do I password protect an excel workbook? Debbie B Excel Discussion (Misc queries) 2 August 3rd 09 01:05 PM
XL2007 - password protect workbook? Matthew M \(UK\) Excel Discussion (Misc queries) 1 March 16th 07 03:52 PM
Password Protect a Workbook ? Bubey New Users to Excel 4 December 19th 06 03:13 AM
password protect workbook Rob Excel Discussion (Misc queries) 1 August 16th 06 11:55 AM
password protect on workbook Jo[_6_] Excel Programming 1 January 19th 04 09:37 PM


All times are GMT +1. The time now is 09:47 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"