Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I pasword protect a button in Excel? 1

Status
Not open for further replies.

RFeniuk

Technical User
May 7, 2003
20
IN
I have a custom button in Excel which runs a macro. Can I pasword protect the button so that it asks for a password before running the macro and if so how do I do this. Thanks

Ron
 
Summat like this at the start of the sub

mPass = inputbox("Please enter password to run macro")
if mPass <> &quot;Password&quot; then
msgbox &quot;Incorrect password&quot;
exit sub
else
end if

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Thanks Geoff You tip is much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top