aequitas1903
Board Regular
- Joined
- Mar 8, 2012
- Messages
- 127
Hi everyone,
I am always creating some excel templates. In this templates, I create auto_open() macro to check if the user is in allowed user list. If yes, user can work on the template. Otherwise excel closes itself immediately.
I am doing this by entring the allowed users computer name on a sheet. and vlookup the Environ$("Username"). The templates are workbook,worksheet and vba protected. So if I need to add a user it takes too much time to do the necessary changes. And I have to do that in all templates.
The question is if there is a way to create a user list in vba code itself? So I can easily enter the vba password and add the new user in every template quickly. I won't need to unprotect sheet update lookup range and etc.
And is it possible to identify the users with names.
For Example
the list name will be Allowed_staff
and in that list; the users (Environ$("Username") ) are PC123 , PC456, PC789
PC123 = "Susan Red"
PC456 = "John Green"
PC789 = "Tom Blue"
I am using vlookup to check the user name and send a greeting msgbox
Please let me know if you think of a way to do this.
Kind regards
I am always creating some excel templates. In this templates, I create auto_open() macro to check if the user is in allowed user list. If yes, user can work on the template. Otherwise excel closes itself immediately.
I am doing this by entring the allowed users computer name on a sheet. and vlookup the Environ$("Username"). The templates are workbook,worksheet and vba protected. So if I need to add a user it takes too much time to do the necessary changes. And I have to do that in all templates.
The question is if there is a way to create a user list in vba code itself? So I can easily enter the vba password and add the new user in every template quickly. I won't need to unprotect sheet update lookup range and etc.
And is it possible to identify the users with names.
For Example
the list name will be Allowed_staff
and in that list; the users (Environ$("Username") ) are PC123 , PC456, PC789
PC123 = "Susan Red"
PC456 = "John Green"
PC789 = "Tom Blue"
I am using vlookup to check the user name and send a greeting msgbox
Please let me know if you think of a way to do this.
Kind regards