|
楼主 |
发表于 2018-7-9 14:26
|
显示全部楼层
Public ARR
Private Sub UserForm_Activate()
ARR = Sheet8.Range("A3:K" & Sheet8.Range("A65536").End(3).Row)
TextBox1.Text = ""
For i = 2 To UBound(ARR)
ComboBox1.AddItem ARR(i, 1)
Next
End Sub
Private Sub CommandButton2_Click()
Unload UserForm1
End Sub
Private Sub CommandButton1_Click() '登录按钮
For i = 2 To UBound(ARR)
If ComboBox1.Text = ARR(i, 1) And TextBox1.Text = ARR(i, 2) Then
For j = 3 To 11
If ARR(i, j) Then Sheets(ARR(1, j)).Visible = True
Next
MsgBox ComboBox1.Text & "你好!欢迎你进入本系统", 1 + 64, "六—学区间1号施工竖井"
Application.Visible = True
Unload UserForm1
Exit Sub
End If
Next
MsgBox "用户名或密码输入错误,请重新输入!", vbOKOnly + vbExclamation, "错误"
TextBox1 = ""
End Sub
可以给批注解释一下吗? |
|