Can I prevent a user from running a macro?

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

I have a macro that I want to be able to call from other macros, but it is
important that it cannot be run by users.

I have tried making it Private, but then the other macros also can't call
it.

Is there a way around this?

Thanks

Michelle
 
Bloomin' marvellous answer - I can't believe I've not come across this
before - Thank you

M
 
You could even ask for a password...

Option Explicit
Sub MichelleOnly()
dim myStr as string

myStr = inputbox(prompt:="What's the password")

if mystr <> "ThisISToPSecRet" then
exit sub
end if

'rest of code
End sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top