Private Sub cmdok_Click()
Application.ScreenUpdating = False
Static i As Integer
'If CStr(user.Value) = Right(Names("username").RefersTo, Len(Names("username").RefersTo) - 1) And CStr(password.Value) = Right(Names("userword").RefersTo, Len(Names("userword").RefersTo) - 1) Then
If user.Value = Evaluate(Names("UserName").RefersTo) And password.Value = Evaluate(Names("Userword").RefersTo) Then
Unload Me
Application.Visible = True
Else
i = i + 1
If i = 4 Then
MsgBox "对不起,你无权打开工作薄!", vbInformation, "提示"
ThisWorkbook.Close savechanges:=False
Else
MsgBox "输入错误,你还有" & (3 - i) & "次机会。", vbExclamation, "提示"
user.Value = ""
password.Value = ""
End If
End If
Application.ScreenUpdating = True
End Sub[code=VBA[/code]
密码为什么只能打数字 要怎么写才能打出字母?