|
Sub test()
1:
n = n + 1
If n > 3 Then Exit Sub
user = InputBox("请输入用户名", "用户")
If user = "" Then MsgBox "用户名不能为空": GoTo 1
Set yh = Sheet1.Range("a:a").Find(user, , , xlWhole)
'MsgBox yh.Offset(0, 1).Value
If yh Is Nothing Then
GoTo 1
End If
2:
m = m + 1
If m > 3 Then Exit Sub
pass = InputBox("请输入密码", "密码")
If pass = "" Then MsgBox "密码不能为空": GoTo 2
If pass * 1 <> yh.Offset(0, 1).Value Then
GoTo 2
End If
MsgBox "登录成功"
End Sub
|
|