|
楼主 |
发表于 2012-7-10 18:40
|
显示全部楼层
Private Sub CommandButton1_Click()
Dim a As String, b As String
Dim i As Integer, ir As Integer
If ComboBox1.Text = "" Or TextBox1.Text = "" Then
MsgBox "请填写齐全!", 1 + 64, "系统登陆"
'TextBox1.SetFocus
Exit Sub
End If
a = ComboBox1.Text
b = TextBox1.Text
i = Sheet5.[A:A].Find(a, Lookat:=xlWhole).Row
If Sheet5.Cells(i, 2) = b Then
Unload UserForm1
MsgBox ComboBox1.Text & "你好,欢迎你进入本系统!", 1 + 64, "欢迎词"
Application.Visible = True
Else
MsgBox "登陆密码错误,请重新输入!"
Exit Sub
End If
If i = 3 Then
For i = 2 To 5
Sheets(i).Visible = xlSheetVisible
Next
ElseIf i = 4 Then
For i = 2 To 4
Sheets(i).Visible = xlSheetVisible
Next
Else
Sheet4.Visible = xlSheetVisible
End If
end sub |
|