Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code which display a Message box if certain conditions
are not met. What I wish is that it should only show the first message and not process any of the re-maiing part of the macro. It should just stop, but it doesn't. So as below, it sholdn't execute "Tuesday" if "Monday" is displayed Thanks Sub Generate_Reports() Sheets("Figures").Select With Worksheets("Figures") If .Range("AM2").Value < 7 Then MsgBox "You have not explained why your Cash Variance for Monday shows a high variance, you cannot e-mail until you do so" Exit Sub End If End With With Worksheets("Figures") If .Range("AM3").Value < 7 Then MsgBox "You have not explained why your Cash Variance for Tuesday shows a high variance, you cannot e-mail until you do so" Exit Sub End If End With With Worksheets("Figures") If .Range("AM4").Value < 7 Then MsgBox "You have not explained why your Cash Variance for Wednesday shows a high variance, you cannot e-mail until you do so" Exit Sub End If End With <Rest of Macro..... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MSG Box - Stop Macro | Excel Programming | |||
How do I stop a macro from running within a macro? | Excel Programming | |||
Stop running a macro in the middle of a macro | Excel Programming | |||
Macro: With Stop it works. Without Stop it doesn't. | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |