Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a test in my program,
If strOrig < "DYC" Or "" Then After the code below runs, I want the macro to end when strOrig = DYC or is blank. How do I tell it to end? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try adding the exit sub command after the if statement in the macro code.
"davegb" wrote: I have a test in my program, If strOrig < "DYC" Or "" Then After the code below runs, I want the macro to end when strOrig = DYC or is blank. How do I tell it to end? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried:
If strOrig < "DYC" Or "" Then Exit Sub You need to be carefull doing this though as if you have changed any application settings eg screenupdating, displayalerts they will not be reset if you simply exit. Regards Rowan davegb wrote: I have a test in my program, If strOrig < "DYC" Or "" Then After the code below runs, I want the macro to end when strOrig = DYC or is blank. How do I tell it to end? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I think that should have been:
If strOrig = "DYC" Or strOrig = "" Then Exit Sub Rowan wrote: Have you tried: If strOrig < "DYC" Or "" Then Exit Sub You need to be carefull doing this though as if you have changed any application settings eg screenupdating, displayalerts they will not be reset if you simply exit. Regards Rowan davegb wrote: I have a test in my program, If strOrig < "DYC" Or "" Then After the code below runs, I want the macro to end when strOrig = DYC or is blank. How do I tell it to end? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
looping and stopping when a condition is met - test | Excel Discussion (Misc queries) | |||
How do I test a condition in one cell and write to another. | Excel Worksheet Functions | |||
logical test for an #N/A condition in a cell | Excel Discussion (Misc queries) | |||
Cell text based on 4 condition test | Excel Worksheet Functions | |||
Code to Test Condition and Save Record to Excel | Excel Programming |