Hi All,
I'm trying to password protect a macro buttom but not sure of how to do it based on the code I've been using for the macro?
Help very much appreciated!
GavinPlease Login or Register to view this content.
Hi All,
I'm trying to password protect a macro buttom but not sure of how to do it based on the code I've been using for the macro?
Help very much appreciated!
GavinPlease Login or Register to view this content.
I'd suggest that you use an InputBox (to get the password) as the first thing you do in the subroutine. Then, if it is accepted, carry on, if not, exit the subroutine.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Hi thanks for this really do appreciate your help.
I'm not sure how to do an inputbox? I think I've got some code to do this but not sure how to push it into the existing code?
This is what I've found?
Please Login or Register to view this content.
That's a specific type of InputBox with a specific type of input, namely a range, hence the reason for Set=.
You can get away with dimming a variant variable and just using InputBox (not the app bit). Note that you can't mask the password characters with either of thes functions, which may or may not be a problem.
So, you could just use pw=InputBox(...).
Test the pw variable, if it's blank, either enter has been pressed with no data, or Cancel has been pressed.
If you get data input, you can check it.
Just type InputBox, select it and press F1 to see the Help for more details.
Regards, TMS
Hi sorry I'm being dumb I don't know how to input this into the code?
Please Login or Register to view this content.
Not tested as I'm away from my computers but that should give you the idea.
Regards, TMS
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks