Private Sub CommandButton1_Click()
If TextBox1.Value = "" Then
If TextBox2.Value = "" Then
MsgBox "Please Input the User Name and the Password"
Else
MsgBox "Please Input the User Name"
End If
ElseIf TextBox1.Value = "admin" Then
If TextBox2.Value = "" Then
MsgBox "Please Input the Password"
ElseIf TextBox2.Value = "1234" Then
Me.Hide: Application.Visible = True
Else
MsgBox "Please Input the right User Name and the right Password"
End If
Else
If TextBox2.Value = "" Then
MsgBox "Please Input the Password"
Else
MsgBox "Please Input the right User Name and the right Password"
End If
End If
End Sub
Private Sub CommandButton2_Click()
ThisWorkbook.Application.Quit
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
ThisWorkbook.Application.Quit
End Sub