Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have put together a macro for entering a password. How do I go about putting in a loop or some other ingenious bit of code so that you only get 3 chances before you get booted out. My code is attached to a very simple form and is as follows: Public Sub PasswordOK_Click() Dim Password As String Dim count As Integer Password = "" If TextBox1 = Password Then Personal_Details.Show Unload Me End If If TextBox1 < Password Then TextBox1 = "" Label1.Visible = True PasswordOK.Visible = False PasswordCancel.Visible = False Application.Wait Now + TimeValue("00:00:02") Label1.Visible = False PasswordOK.Visible = True PasswordCancel.Visible = True End If End Sub Private Sub PasswordCancel_Click() Unload Me End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True Beep End If End Sub -- Shake ------------------------------------------------------------------------ Shake's Profile: http://www.excelforum.com/member.php...o&userid=28577 View this thread: http://www.excelforum.com/showthread...hreadid=483069 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Highlighting chances in shared worksheets | Excel Worksheet Functions | |||
Need help! Chances are it's a simple formula I'm overlooking | Excel Discussion (Misc queries) | |||
Terrible Excel Ruined My Chances of Graduation | Excel Discussion (Misc queries) | |||
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. | Excel Worksheet Functions | |||
bypass password when update linking of password protected file | Excel Discussion (Misc queries) |