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
 

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

Similar Threads


Back
Top