Automatically set conditions, hidden sheets based on user sign in

The Jade

New Member
Joined
Nov 2, 2011
Messages
10
I have quite a large workbook with several sheets that talk to each other.

This sheet is updated every once in a while and shared with a team.
The team is divided into 2 main groups(in the future maybe more); admin and regular staff.

Therefore, each group will have access to specific sheets (if a group does not have access to a specific sheet, the latter will be hidden).

Now, the problem that I have is that, everytime I Need to update that data in one of the sheets, I have to save different worksheets based on what group the team members are part of.
This is a bit annoying on the Long run as it requiers a lot of manual work and is prone to mistakes.

To simply things, here are sample sheets:


Home (admin) - Only Admin members have access to
Home (regular) - Only Regular members have access to

Report Admin - Only Admin members have access to
Report Regular - Only Regular members have access to

DB - Both groups have access to it.

At the moment, I have 2 files:
Workbook - Admin (showing only sheets accessible to admin: Home (admin) - Report Admin and DB
Workbook - Regular (showing only sheets accessible to regular: Home (regular) - Report Regular and DB

I would therefore like to have one file, "Workbook", with a Login access.
So, if a member of Admin staff enters their login details, it will automatically show sheets accessible to Admin
Same for Regular.

Is this possible?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
if you can use the Environ(user) then you can use a case statement from the workbook open event
 
Upvote 0
Private Sub Workbook_Open()
USER_ID
End Sub

Sub USER_ID()
Dim WHO As String
WHO = Environ("UserName")

CASE
explained here > https://www.techonthenet.com/excel/formulas/case.php

End Sub

CASE basically allows you to test from the user and create a set of instructions to suit the user
 
Last edited:
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules. Be sure to follow & read the link at the end of the rule too!

Cross posted at: Automatically set conditions, hidden sheets based on user sign in

If you do cross-post in the future and also provide a link, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,214,570
Messages
6,120,294
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top