I Created a user password form for a sheet but i don't want it to re-open if the user submits the correct information. i.e when you click on the sheet it opens, then if the password is correct it can close however if you try to click on the sheet it reopens again its kind of a loop.
Private Sub CommandButton1_Click()
Dim a As String
a = "aaa"
password = txtPassword.Text
If password = a Then
Unload Me
ActiveWorkbook
Else
MsgBox "Password Incorrect. Please try again.", vbCritical
End If
End Sub