View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
John[_22_] John[_22_] is offline
external usenet poster
 
Posts: 694
Default How to cancel a macro once started?

Thank you Daniel
It works great
Have a nice day
John
"Daniel.C" wrote in message
...
Try :
answ = MsgBox("Are you really sure ?", vbYesNo)
If answ = vbNo Then Exit Sub
' delete
Regards.
Daniel

I know nothing about VBA except the recorder and able to modify a bit.
I have a macro to erase a form that is activated with a button. I would
like to be able to
have a message to confirm the deletion (Msgbox ) but have the choice to
say no and stop the macro from erasing.
I would appreciate any help please
Thanking you in advance
John