View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Error Message in VBA

hi,
just after the input box statement put this...
If MsgBox("do you really want to do this?", vbOKCancel, Confirm) = vbCancel
Then
MsgBox ("Process terminated.")
Exit Sub
End If

regards
FSt1

"Elise148" wrote:

If I wanted to put an error or info message in my VBA code, so that if the
person running the macro wanted to Cancel instead of Okay an input box and no
changes would be made to the excel document, how would I do that?

I'd appreciate any ideas!

Elise