ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Restricted Access (https://www.excelbanter.com/excel-worksheet-functions/200211-restricted-access.html)

sb

Restricted Access
 
I have a large workbook with several different woksheets in it.
Each worksheet refers to a different individual. Is there a way that I can
set up this workbook so that only certain people can see each spreadsheet.
Obviously I know how to protect cells from changes and passwording things,
etc but I have never tried to do anything this complex.
I would rather keep all these spreadsheets in the one place rather than set
one up for each individual if possible.
I know there is some protection system that can be set up/downloaded but I
can't be sure that all my users have that.
Can anyone help me?


Bob Phillips[_3_]

Restricted Access
 
The name sin the open routine are the login ids, so adapt them and the
orksheet names to reality.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Worksheets("Master").Visible = xlSheetVisible
Worksheets("Eugene").Visible = xlSheetVeryHidden
Worksheets("Joe").Visible = xlSheetVeryHidden
Worksheets("Mick").Visible = xlSheetVeryHidden
Worksheets("Sarah").Visible = xlSheetVeryHidden
'etc.

Me.Save
End Sub

Private Sub Workbook_Open()

Select Case Environ("Username")

Case "EMcIntyre": Worksheets("Eugene").Visible = xlSheetVisible
Case "JJones": Worksheets("Joe").Visible = xlSheetVisible
Case "MickM": Worksheets("Mick").Visible = xlSheetVisible
Case "SarahBrown": Worksheets("Sarah").Visible = xlSheetVisible
'etc.
End Select

End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
__________________________________
HTH

Bob

"SB" wrote in message
...
I have a large workbook with several different woksheets in it.
Each worksheet refers to a different individual. Is there a way that I
can
set up this workbook so that only certain people can see each spreadsheet.
Obviously I know how to protect cells from changes and passwording things,
etc but I have never tried to do anything this complex.
I would rather keep all these spreadsheets in the one place rather than
set
one up for each individual if possible.
I know there is some protection system that can be set up/downloaded but
I
can't be sure that all my users have that.
Can anyone help me?





All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com