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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit Excel Macro to run from Hot Key sequence only

Status
Not open for further replies.

olympus

Technical User
Apr 16, 2002
26
US
I have a workbook in which all of the macros are password protected by the following line of code:

If Sheet1.TextBox1.Text <> "passsword" Then Exit Sub

I would like to be able to run a macro that is still password protected using the above code with a hot key/short cut key even if the password is not correct. I want to prevent all but the people that know the proper hot key sequence from running the macro. I would like this hot key to bypass the above line that requires the proper password in textbox1. Thanks!
 
olympus,

Make the Macro a Function with an argument.

The Hot Key macro calls the Macro Function.

You can call the Macro Function.

I specify a function so that it will not appear in the Macros Menu.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Skip, How do you specify a function so that it will not appear in the Macros Menu? Thanks.
John
 
How do you specify a function so that it will not appear in the Macros Menu?
Public Function yourFunctionName(Optional dumyArg As String = "some value") As yourFunctionReturnType

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top