View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default How can I have 45 mulitple sheets with 45 different acess rights to view to each sheet

Sam

Most things are possible. This is *very* theoretical and needs much more error checking code, etc. I have used a Workbook_SheetDeActivate() event to fire a password as a sheet called User1 is fired. If the password is not correct the code returns to sheet1.

You might for example want to use the worksheet code name, which means the code will still work if the worksheet tab name is changed and you may want to store the passwords for each sheet on another worksheet which is hidden using xlVeryHidden. (This cannot then be seen in the UI and only un-hidden through code), but this would make maintenance far easier.

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Dim ans As Variant
If Sh.Name = "User1" Then
ans = InputBox("Enter your password", "Password")
If ans = "Password" Then
Exit Sub
End If
End If
Worksheets("Sheet1").Activate
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"SAM SEBAIHI" wrote in message ...

I have 45 different sheets for 44 different workers in one workbook. How can I allow all 45 workers to be able to view sheet (1) and


sheet (2) can be viewed and edited only by the worker who will enter a password 22sa
sheet (3) can be viewed and edited only by the worker who will enter a password 164
sheet (4) can be viewed and edited only by the worker who will enter a password xyz
etc...up to 45 different workers

Keep in mind that there are some cells are protected and some are not in all the sheet.

Is there a way?


------------------------------------------------------------------------------

Sam Sebaihi