View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
exalan exalan is offline
external usenet poster
 
Posts: 28
Default Different Passwords for different worksheets in one workbook

Hi Eduardo

Thanks for the advice.

I've created 3 worksheets "Alan", "Adrian" & "Andrew" and copy & paste the
macros and added the respective passwords as you've guided. However, I can
only open the 2nd and 3rd worksheets. As for the 1st worksheet ("Alan"), it
can open but the screen is locked (blueish screen).

Appreciate if you can investigate and advise.

Best regards

--
exalan


"Eduardo" wrote:

Hi,
in the worksheet name for each manager right click, then paste the code as
follow, you will have to change the passwword, you will see three places with
the password, in the example below MANAGER. so then you hide the worksheet.
When opening a popup will show up asking for the password

if this helps please click yes thanks


Private Sub Worksheet_Activate()
Dim strPassword As String
On Error Resume Next
Me.Protect Password:="MANAGER"
Me.Columns.Hidden = True

strPassword = InputBox("Enter password to access DATA sheet")

If strPassword = "" Then
ActiveSheet.Visible = False
Worksheets("Menu").Select
Exit Sub
ElseIf strPassword < "MANAGER" Then
MsgBox "Password Incorrect "
ActiveSheet.Visible = False
Worksheets("Menu").Select
Exit Sub
Else
Me.Unprotect Password:="MANAGER"
Me.Columns.Hidden = False
End If
Range("a1").Select

On Error GoTo 0
End Sub

Private Sub Worksheet_Deactivate()
On Error Resume Next
Me.Columns.Hidden = True
On Error GoTo 0
End Sub

"exalan" wrote:

Hi

I am populating a sales template in one Excel workbook but I want business
unit managers to have access to view their respective worksheet only €¦ I want
to set a restriction, maybe by using password.
So, each manager will be given a password and they need to enter it when
opening the file, then they can only view what is within their own worksheet.

Is it possible in Excel to do so?

Please help....

--
exalan