View Full Version : Solved: User Id/Password

01-20-2011, 09:13 AM
Hello Everyone,

I have a spreadsheet with several form control buttons. I also have to groups of Users that input data. I would like some users access to all control buttons while restrict access to some buttons in the other group. Can you give me some advice on how I can accomplish this? I would also like the Users with complete access to have the ability to change User Id's and Passwords for all Users when necessary. I was thinking of a User form with two list boxes but I'm not sure how to proceed. Any thoughts on how I can proceed?

Any info will be greatly appreciated!

Thank you.

Kenneth Hobs
01-20-2011, 10:25 AM
You will have lots to consider. For a password userform, add a textbox control and set the PasswordChar. Make the userform modeless and if the password for a user is correct, unhide the veryhidden sheet of passwords.

01-20-2011, 07:47 PM
unhide the veryhidden sheet of passwords.

But we can open this sheet by OpenOffice Program

01-20-2011, 11:17 PM
I think it was a simple error by Kenneth, when he referred to "unhide the veryhidden sheet".

Your logic should be if a User enters the correct password, then the allocated buttons for the level of User, becomes active to this User.

Kenneth Hobs
01-21-2011, 06:36 AM
If you are going to use OpenOffice, then why post to an Excel forum? Maybe you mean that OpenOffice breaks Excel password protection?

As I said, there are several issues with doing these things. Excel is not all that secure to begin with. However, for the novice to intermediate level user, you can do things to make it more difficult to break protection.

A common problem using macros is that macros can be bypassed. The way to fix that is to always hide and protect all sheets when you close the workbook. When they open the workbook and the macros are disabled, the sheet(s) will not be seen. I usually leave one sheet open showing that macros were disabled.

I unhide veryhidden sheets that contains the userids and passwords very easily using code. Passwords are needed for the userform, workbook, worksheet(s), and vbaproject as one would expect. I would not put passwords for userids other than in code for "super" users.

Speaking of userids, you can use Environ("username") or Application.Username. The first is your Windows username and the second is your name in the Excel Application. Both can be changed by the user easily but I recommend using the first.

To sum it up, while there are levels of users and levels of protection, do not expect Excel to meet every security need.

01-21-2011, 10:17 AM
Thank you for your advice.

01-24-2011, 01:34 AM
This is a small example of something I have used to limit user access to selected worksheets. It can also be adapted to limit access to certain cells, rows, or columns on a common sheet.

No password required for Level 1 access. Level 2 password is zxzx. Admin password is Cricket. No password for the VBE.

Just something to play around with and maybe it will give you some idea of a direction to go.


02-02-2011, 09:54 AM
Thank you very much for your time and input. Capt. Ron Thank you for all the information in that spreadsheet. You've given me some ideas on how to proceed. Thank you again!