View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Stop after IF Then

As Mike said, it is hard to tell exactly what you doing without seeing your
code. However, when you say you want to stop "after whichever If Then
statement applies first" sounds like your code is looping down a column of
invoice numbers looking for a "current" invoice number and, once found, you
take action and then want to stop. If that is what you are doing, I think
you can eliminate the loop altogether and use the Find method (of a range)
to locate your "match", and then just do whatever you are doing to that
found reference.

--
Rick (MVP - Excel)


"bgkgmg" wrote in message
...
I'm running macro with many If Then statements. If Then applies to
matching
invoice numbers and then moving info to row on another sheet. I am
locking
cells that are involved on sheet2 and protecting worksheet after each one.
I
would like macro to stop running after whichever If Then statement applies
first so other rows of If Then statements are not locked thus allowing me
to
enter next statement.
I hope you understand question.
Thanks
Bobby