ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Password protected userform (https://www.excelbanter.com/excel-discussion-misc-queries/158407-password-protected-userform.html)

AOU

Password protected userform
 
How do I password protect a userform.So that only key people can open a
userform. Also is it possible to change the password in the future?
--
AOU

Dave Peterson

Password protected userform
 
You can change the procedure that shows the userform.

Dim myPWD as string
dim UserPWD as string
mypwd = "hi"
userpwd = inputbox(Prompt:="Password")
if userpwd < mypwd then
msgbox "Not authorized"
exit sub '???
end if
'keep going

You could change the password in the code and redistribute the workbook.

You could store the password in a text file that everyone has access to--but
encrypt that password and then read the string from that text file and translate
it to what you need.



AOU wrote:

How do I password protect a userform.So that only key people can open a
userform. Also is it possible to change the password in the future?
--
AOU


--

Dave Peterson

AOU

Password protected userform
 
Thanks Dave. It works well.
I was thinking of storing the password in a worksheet(which is hiden) and
protecting the project. How would I refir the password to a cell in a
worksheet, say sheet3.
--
AOU


"Dave Peterson" wrote:

You can change the procedure that shows the userform.

Dim myPWD as string
dim UserPWD as string
mypwd = "hi"
userpwd = inputbox(Prompt:="Password")
if userpwd < mypwd then
msgbox "Not authorized"
exit sub '???
end if
'keep going

You could change the password in the code and redistribute the workbook.

You could store the password in a text file that everyone has access to--but
encrypt that password and then read the string from that text file and translate
it to what you need.



AOU wrote:

How do I password protect a userform.So that only key people can open a
userform. Also is it possible to change the password in the future?
--
AOU


--

Dave Peterson


Dave Peterson

Password protected userform
 
if userpwd < thisworkbook.worksheets("Sheet13").range("a1").val ue then

If Sheet13 is the name you see on the worksheet tab when that worksheet is
visible.

AOU wrote:

Thanks Dave. It works well.
I was thinking of storing the password in a worksheet(which is hiden) and
protecting the project. How would I refir the password to a cell in a
worksheet, say sheet3.
--
AOU

"Dave Peterson" wrote:

You can change the procedure that shows the userform.

Dim myPWD as string
dim UserPWD as string
mypwd = "hi"
userpwd = inputbox(Prompt:="Password")
if userpwd < mypwd then
msgbox "Not authorized"
exit sub '???
end if
'keep going

You could change the password in the code and redistribute the workbook.

You could store the password in a text file that everyone has access to--but
encrypt that password and then read the string from that text file and translate
it to what you need.



AOU wrote:

How do I password protect a userform.So that only key people can open a
userform. Also is it possible to change the password in the future?
--
AOU


--

Dave Peterson


--

Dave Peterson

AOU

Password protected userform
 
Dave,
Great stuff. It works a treat.
Thank very much
--
AOU


"Dave Peterson" wrote:

if userpwd < thisworkbook.worksheets("Sheet13").range("a1").val ue then

If Sheet13 is the name you see on the worksheet tab when that worksheet is
visible.

AOU wrote:

Thanks Dave. It works well.
I was thinking of storing the password in a worksheet(which is hiden) and
protecting the project. How would I refir the password to a cell in a
worksheet, say sheet3.
--
AOU

"Dave Peterson" wrote:

You can change the procedure that shows the userform.

Dim myPWD as string
dim UserPWD as string
mypwd = "hi"
userpwd = inputbox(Prompt:="Password")
if userpwd < mypwd then
msgbox "Not authorized"
exit sub '???
end if
'keep going

You could change the password in the code and redistribute the workbook.

You could store the password in a text file that everyone has access to--but
encrypt that password and then read the string from that text file and translate
it to what you need.



AOU wrote:

How do I password protect a userform.So that only key people can open a
userform. Also is it possible to change the password in the future?
--
AOU

--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com