msgbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd need to insert an option on my macro where if yes is selected the macro
will keep running. If cancel is selected the macro will stop and no changes
are made.
 
Try some code like

Dim Res As Long
Res = MsgBox("Do you want to continue?", vbYesNo)
If Res = vbNo Then
Exit Sub
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Hi, try:

If vbCancel = MsgBox("Continue process?", vbOKCancel, "Process") Then
MsgBox "Process cancelled"
Exit Sub 'Process cancelled
End If
MsgBox "Process continuing"

Regards,
Sebastien
 

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

Back
Top