How can I have 45 mulitple sheets with 45 different acess rights to view to each sheet

S

SAM SEBAIHI

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?
 
N

Nick Hodge

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
(e-mail address removed)
www.nickhodge.co.uk



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?
 
S

SAM SEBAIHI

Thank you so much Nick!

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

Sam Sebaihi
Faculty
Western International University
Associate Programs
(e-mail address removed)
(e-mail address removed) (alternate email)
Phone #: (405)315-8223 Time zone: Pacific Time
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
(e-mail address removed)
www.nickhodge.co.uk



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?
 
N

Nick Hodge

Pleasure

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk



Thank you so much Nick!

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

Sam Sebaihi
Faculty
Western International University
Associate Programs
(e-mail address removed)
(e-mail address removed) (alternate email)
Phone #: (405)315-8223 Time zone: Pacific Time
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
(e-mail address removed)
www.nickhodge.co.uk



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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top