MsgBox working is Excel Macro Programming

  • Thread starter Thread starter Vikas Vadgama
  • Start date Start date
V

Vikas Vadgama

I want a MsgBox when the macro starts with 2 buttons. If user presses OK
button, macro continues. If user presses Cancel button, macro ends. Can
someone please advise how to do the same.
 
Sub Macro()
If MsgBox("Do you want to continue?", vbOKCancel) <> vbYes Then Exit Sub
'your code continues

End Sub

If this post helps click Yes
 
Back
Top