View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rowan[_8_] Rowan[_8_] is offline
external usenet poster
 
Posts: 55
Default How to end when test condition met?

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?