|
练习一下:
- Sub showDATA()
- Dim s1$, s2$, n%
- s1 = Application.Caller
- ActiveSheet.Unprotect Password:=mYpASS
- 110:
- n = n + 1
- If n > 3 Then
- MsgBox "密码错误3次,这不是你该看的!", vbInformation, "提醒"
- Exit Sub
- ActiveSheet.Protect Password:=mYpASS
- End If
- s2 = Application.InputBox("请输入密码:", "权限管理", Type:=2)
- Columns("B:C").Hidden = True
- Select Case s1
- Case "南方区":
- If s2 = "123" Then Columns("C").Hidden = False Else GoTo 110
- Case "北方区":
- If s2 = "234" Then Columns("D").Hidden = False Else GoTo 110
- Case "西区":
- If s2 = "345" Then Columns("E").Hidden = False Else GoTo 110
- Case "all":
- If s2 = "111" Then Columns("A:E").Hidden = False Else GoTo 110
- End Select
- ActiveSheet.Protect Password:=mYpASS
- Beep
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|