Hello
I'm building an Excel model that requires several different access rights levels for different user groups. The model prompts the user to select which level they require and then enter the correct password. Currently I have manually set up the 'Visible' and 'Protect Sheet' properties in the VBA code for each sheet based on the access level required, but this is time consuming and requires regular maintenance as and when requirements change.
The first tab in the model is an 'Index' tab that contains a table of the tab names in the first column, and then for each access level ('Admin', 'Editor' and 'Viewer') there are two columns - one governs the Visibility of each tab (ie: Visible, Hidden or Very Hidden) and the other column the protect sheet status (a simple 'Yes' or 'No').
What I'm looking for is code that I can add to the User Forms code (for the password pop-ups), so that when the user enters the correct password, for each sheet the code reads along the table in the 'Index' tab and sets the 'Visible' and 'Protect Sheet' properties based on the values in the table. The table in questions looks like the attached example below:
IndexTab_AccessRightsTable.jpg
As you can see from the settings used in this example, only 'Admin' level users have full unlocked access to every tab, the principle being that it gives model architects final control of the overall structure and behaviour of key aspects of the model.
If anyone can help it would be hugely appreciated as always
Kind regards and many thanks
Stephen
Bookmarks