Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Dear experts,
I want to create an userform with a textbox in which users will input a password (e.g. PSSW1223). As usual, the characters input will not be shown but by "********" instead. If the user inputs correctly, a dialogue box appears stating the password is correct. If the password is incorrect, the dialogue box will show the wording on the contrary. The user can have 3 trials at the maximum. Please advise what should the VBA code for the user form. Please kindly advise. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
Setup at userform with a textbox and a command button. First select TextBox1 and in the Properties window (F4), find 'PasswordChar' and enter * Then try this code and notice that the dim statement has to be inserted at the very top of the userform module: Dim Trial As Long Private Sub CommandButton1_Click() TitleStr = "Password check" If Me.TextBox1.Value = "PSSW1223" Then msg = MsgBox("Correct password", vbExclamation + vbOKOnly, TitleStr) Me.Hide 'what to do when password is correct? Else Trial = Trial + 1 If Trial < 3 Then msg = MsgBox("Wrong password, please try again", vbExclamation + vbOKOnly, TitleStr) Me.TextBox1.SetFocus Else msg = MsgBox("Wrong password, shutting down...", vbCritical + vbOKOnly, TitleStr) Unload Me End If End If End Sub Regards, Per "Freshman" skrev i meddelelsen ... Dear experts, I want to create an userform with a textbox in which users will input a password (e.g. PSSW1223). As usual, the characters input will not be shown but by "********" instead. If the user inputs correctly, a dialogue box appears stating the password is correct. If the password is incorrect, the dialogue box will show the wording on the contrary. The user can have 3 trials at the maximum. Please advise what should the VBA code for the user form. Please kindly advise. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password userform activate | Excel Discussion (Misc queries) | |||
Password protected userform | Excel Discussion (Misc queries) | |||
Userform password to show "xxxxxx" in the text box | Excel Discussion (Misc queries) | |||
UserForm Password | Excel Discussion (Misc queries) | |||
Password Userform help !!!! | Excel Discussion (Misc queries) |