ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Password when Check Box is checked (https://www.excelbanter.com/excel-programming/382248-password-when-check-box-checked.html)

Johnny

Password when Check Box is checked
 
I'm searching for VBA code or other means that would prompt for a password
when a check box is checked. I'm not a VBA wiz kid so please be gentle if
this is a stupid question.

Johnny

Password when Check Box is checked
 
Let me add to this. I create a UserForm which contains a text box for the
password entry. I've also added an "Okay" button. What I would like to
happen is when the "Okay" box is clicked it's checks for a specific password
that I have stored in a cell on a hidden worksheet and if it matches what's
type in the it will accept the password and continue on.

"Johnny" wrote:

I'm searching for VBA code or other means that would prompt for a password
when a check box is checked. I'm not a VBA wiz kid so please be gentle if
this is a stupid question.


Dave Peterson

Password when Check Box is checked
 
if me.textbox1.text = thisworkbook.worksheets("hidden").range("a1").valu e then
'do the work
else
msgbox "Not this time, skippy!"
end if

Johnny wrote:

Let me add to this. I create a UserForm which contains a text box for the
password entry. I've also added an "Okay" button. What I would like to
happen is when the "Okay" box is clicked it's checks for a specific password
that I have stored in a cell on a hidden worksheet and if it matches what's
type in the it will accept the password and continue on.

"Johnny" wrote:

I'm searching for VBA code or other means that would prompt for a password
when a check box is checked. I'm not a VBA wiz kid so please be gentle if
this is a stupid question.


--

Dave Peterson

Johnny

Password when Check Box is checked
 
Fantastic! It worked.

"Dave Peterson" wrote:

if me.textbox1.text = thisworkbook.worksheets("hidden").range("a1").valu e then
'do the work
else
msgbox "Not this time, skippy!"
end if

Johnny wrote:

Let me add to this. I create a UserForm which contains a text box for the
password entry. I've also added an "Okay" button. What I would like to
happen is when the "Okay" box is clicked it's checks for a specific password
that I have stored in a cell on a hidden worksheet and if it matches what's
type in the it will accept the password and continue on.

"Johnny" wrote:

I'm searching for VBA code or other means that would prompt for a password
when a check box is checked. I'm not a VBA wiz kid so please be gentle if
this is a stupid question.


--

Dave Peterson


Johnny

Password when Check Box is checked
 
I have a follow up question. On the userform, how do I get the cursor to
appear in textbox1 when it loads?

"Johnny" wrote:

Fantastic! It worked.

"Dave Peterson" wrote:

if me.textbox1.text = thisworkbook.worksheets("hidden").range("a1").valu e then
'do the work
else
msgbox "Not this time, skippy!"
end if

Johnny wrote:

Let me add to this. I create a UserForm which contains a text box for the
password entry. I've also added an "Okay" button. What I would like to
happen is when the "Okay" box is clicked it's checks for a specific password
that I have stored in a cell on a hidden worksheet and if it matches what's
type in the it will accept the password and continue on.

"Johnny" wrote:

I'm searching for VBA code or other means that would prompt for a password
when a check box is checked. I'm not a VBA wiz kid so please be gentle if
this is a stupid question.


--

Dave Peterson


Dave Peterson

Password when Check Box is checked
 
Option Explicit
Private Sub UserForm_Initialize()
Me.TextBox1.SetFocus
End Sub



Johnny wrote:

I have a follow up question. On the userform, how do I get the cursor to
appear in textbox1 when it loads?

"Johnny" wrote:

Fantastic! It worked.

"Dave Peterson" wrote:

if me.textbox1.text = thisworkbook.worksheets("hidden").range("a1").valu e then
'do the work
else
msgbox "Not this time, skippy!"
end if

Johnny wrote:

Let me add to this. I create a UserForm which contains a text box for the
password entry. I've also added an "Okay" button. What I would like to
happen is when the "Okay" box is clicked it's checks for a specific password
that I have stored in a cell on a hidden worksheet and if it matches what's
type in the it will accept the password and continue on.

"Johnny" wrote:

I'm searching for VBA code or other means that would prompt for a password
when a check box is checked. I'm not a VBA wiz kid so please be gentle if
this is a stupid question.

--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 11:21 PM.

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