ExcelBanter

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

Moh

Password userform activate
 
anyone please can you tell me how to use the userform4 with the password

i've created a userform called userform4

i have a label1 "password"

textbox1 for the user to type the password in

Commandbutton1 is OK - if password (7496) is correct then take me to
Banking Sheet
- if wrong password then message box says Sorry please re-enter the correct
password.

Commandbutton2 is Cancel - this should return to main menu


just please show me how this works

Thank you

--
please can you help... its urgent

carlo

Password userform activate
 
Hi Moh

try this
'---------------------------------------
Private Sub CommandButton1_Click()
If Me.TextBox1.Value = 7496 Then
Worksheets("Banking Sheet").Activate
Else
MsgBox "Wrong Password"
Me.TextBox1 = ""
End If
End Sub
'---------------------------------------
Private Sub CommandButton2_Click()
Unload Me
End Sub
'---------------------------------------

hope that helps

Carlo

On Dec 14, 5:26 pm, Moh wrote:
anyone please can you tell me how to use the userform4 with the password

i've created a userform called userform4

i have a label1 "password"

textbox1 for the user to type the password in

Commandbutton1 is OK - if password (7496) is correct then take me to
Banking Sheet
- if wrong password then message box says Sorry please re-enter the correct
password.

Commandbutton2 is Cancel - this should return to main menu

just please show me how this works

Thank you

--
please can you help... its urgent



Moh

Password userform activate
 
carlo that worked many thanks 1 last thing please.....

say if i create a new worksheet (called users)
column A is list of users
column B is list of passwords

Again using Userform4
textbox1 is for username
textbox2 is for passwords

commandbutton1 is for OK - takes me to the banking sheet if correct username
and password

commandbutton2 is for Cancel - takes me to the main menu worksheet.

can you write out a code for this pls
--
please can you help... its urgent


"carlo" wrote:

Hi Moh

try this
'---------------------------------------
Private Sub CommandButton1_Click()
If Me.TextBox1.Value = 7496 Then
Worksheets("Banking Sheet").Activate
Else
MsgBox "Wrong Password"
Me.TextBox1 = ""
End If
End Sub
'---------------------------------------
Private Sub CommandButton2_Click()
Unload Me
End Sub
'---------------------------------------

hope that helps

Carlo

On Dec 14, 5:26 pm, Moh wrote:
anyone please can you tell me how to use the userform4 with the password

i've created a userform called userform4

i have a label1 "password"

textbox1 for the user to type the password in

Commandbutton1 is OK - if password (7496) is correct then take me to
Banking Sheet
- if wrong password then message box says Sorry please re-enter the correct
password.

Commandbutton2 is Cancel - this should return to main menu

just please show me how this works

Thank you

--
please can you help... its urgent





All times are GMT +1. The time now is 10:03 AM.

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