#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default msgbox

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default msgbox

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



"Qaspec" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default msgbox

Hi, try:

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

Regards,
Sebastien

"Qaspec" wrote:

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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox bumper338 Excel Discussion (Misc queries) 1 December 22nd 06 11:32 PM
msgbox flow23 Excel Discussion (Misc queries) 0 January 10th 06 03:25 PM
MsgBox Ed Excel Programming 3 November 23rd 03 05:44 PM
MsgBox Help! rbanks Excel Programming 4 November 21st 03 04:17 PM
msgbox Marcus Excel Programming 3 November 19th 03 11:35 PM


All times are GMT +1. The time now is 03:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"