|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
ThisWorkbook
- Private Sub Workbook_Open()
- Application.Visible = False
- For i = 1 To Sheets.Count - 1
- Sheets(i).Visible = 2
- Next
- MyWelcomeLogo.Show
- End Sub
复制代码
MyWelcomeLogo 窗体代码
- Private Sub Enter_Click()
- R1 = Sheet1.UsedRange.Rows.Count
- c1 = Sheet1.UsedRange.Columns.Count
- With Worksheets(1)
- For i = 1 To R1
- ' MsgBox .Cells(i, 1) & "**" & .Cells(i, 2)
- If Account_.Text = .Cells(i, 1) And Password_.Text = .Cells(i, 2) Then
-
- Set c = .Range(.Cells(i, 5), .Cells(i, c1)).Find("y", , , 1)
- If Not c Is Nothing Then
- firstAddress = c.Address
- Do
- Worksheets(c.Column - 4).Visible = -1
- Set c = .Range(.Cells(i, 5), .Cells(i, c1)).FindNext(c)
- Loop While Not c Is Nothing And c.Address <> firstAddress
- End If
- Application.Visible = True
- Unload MyWelcomeLogo
- Exit Sub
- End If
- Next
- End With
- MsgBox "user name or password error, access denied."
- Password_.Text = ""
- Password_.SetFocus
- End Sub
复制代码 |
|