访问用户locking的Excel文档中的多个页面

我试图创build一个预算文档,其中每个部门只能访问他们的特定页面 – 我有这部分工作 – 我有麻烦让一个pipe理员访问所有的网页。 这就是我作为UserForm的代码到目前为止:(我想“斯科特”能够打开所有的页面,而不仅仅是“概述”)

Dim bOK2Use As Boolean Private Sub btnOK_Click() Dim bError As Boolean Dim sSName As String Dim ws As Worksheet Dim p As DocumentProperty Dim bSetIt As Boolean bOK2Use = False bError = True If Len(txtUser.Text) > 0 And Len(txtPass.Text) > 0 Then bError = False Select Case txtUser.Text Case "Scott" sSName = "Overview" If txtPass.Text <> "act2" Then bError = True Case "Chris" sSName = "Run Crew" If txtPass.Text <> "act2" Then bError = True Case Else bError = True End Select End If If bError Then MsgBox "Invalid User Name or Password" Else 'Set document property bSetIt = False For Each p In ActiveWorkbook.CustomDocumentProperties If p.Name = "auth" Then p.Value = sSName bSetIt = True Exit For End If Next p If Not bSetIt Then ActiveWorkbook.CustomDocumentProperties.Add _ Name:="auth", LinkToContent:=False, _ Type:=msoPropertyTypeString, Value:=sSName End If bOK2Use = True Unload UserForm1 End If End Sub Private Sub UserForm_Terminate() If Not bOK2Use Then ActiveWorkbook.Close (False) End If End Sub 

谢谢!