Thread: Macro help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro help

Option Explicit
Sub YourMacroNameHere()
Dim Resp as long
'more declares...

'before you do anything
resp = msgbox(Prompt:="You sure you want to run this?", buttons:=vbyesno)
if resp = vbno then
exit sub
end if

'rest of your code
end sub



belvy123 wrote:

Hi All
I have a Macro That I use to unprotect a form in my production sheet
it is used by using CTRL U

How can I make this so if someone happens to hit these keys inadvertantly
that it will not work or will need a password to make it work??

any suggestions

Thanks

--
crunchnin numbers


--

Dave Peterson