|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub CommandButton3_Click()
Dim a As String
Dim b As String
Dim c As Range
a = ComboBox1.Text
b = TextBox1.Text
Set c = ThisWorkbook.Worksheets("user").[a:b].Find(a, , , 1)
If a = "" Or b = "" Then
MsgBox ("用户名或密码不能为空!"), vbInformation, "收款管理系统V2.0"
'End If
Else
If Not c Is Nothing Then
If c.Offset(0, 1).Text = TextBox1.Text Then
MsgBox ("欢迎进入系统!"), vbInformation, "收款管理系统V2.0"
'定义主界面
Dim MainForm As Worksheet
Set MainForm = Sheets("主界面")
MainForm.Range("d13") = a
ThisWorkbook.Worksheets("user").Range("c2") = a
ThisWorkbook.Worksheets("user").Range("d2") = b
Unload Me
Application.Visible = True
ThisWorkbook.Sheet3.Visible = xlSheetVeryHidden '需要定义xlSheetVeryHidden的值
Else
MsgBox ("密码错误,请重新输入..."), vbInformation, "收款管理系统V2.0"
TextBox1.SetFocus
End If
End If
End If
End Sub
|
|