
How to exit if statement and not continue with Do Loop
Hello!
Have a routine that looks similar to this:
Sub test_routine
lc = 1
do until cells(lc,1) = empty
if condition A then
Do these things
end if
if condition B then
Do these other things
end if
if condition C then
Do something else
end if
lc=lc+1
loop
I would like to go to the top of the loop if any of the conditions are
true. For example, if condition A is true, I don't want to check for B
or C, just return to the top of the loop.
I thought I could do this with a for/next loop and use the next command
in the if statement but I get an error saying blocked if statement with
out end. I think exiting the if statement with the next statement left
the if statement{*filter*}.
The real application has approximately 40 of these if statements. I
have seen it done using one giant if-elseif statement but seems there
should be a cleaner way of doing it.
thanks,
Randy
Sent via Deja.com
http://www.*-*-*.com/