Password for a macro?

  • Thread starter Thread starter Cerberus
  • Start date Start date
C

Cerberus

Is there a way to create a macro that will only work if you type in the
correct password? I have 6 sales guys using a spreadsheet to build sales
orders but would like a macro the sales manager uses to "approve" the order.

Any ideas on how to go about that? I appreciate any help you give in advance.

Thanks
 
The easiest way is probably to create a userform with a textbox and a button,
store the password in the code or in a label on the form that is not visible
and check what the user enters against this password. If you have the
password exposed in code, make sure you password protect your code.
 
I would just place an InputBox statement at the beginning of the macro
asking for a password. If the password is correct, the remainder of the
macro runs. If not, the macro ends. You can insert a message box if you
wish to tell the user that the password is wrong. You would want to
password protect the code as John suggests. HTH Otto
 
Back
Top