View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
[email protected] NoSpam@aol.com is offline
external usenet poster
 
Posts: 142
Default Is there a VBA flow control statement that will ...

I would like to avoid the complexity of deelpy nested ifs that is sometimes
required. A jump directly to the end of the loop (without using a label)
would be preferred. Many languages have such a statement (such as c's
break statement). I am simply asking if VBA does.

On Sat, 18 Mar 2006 18:25:40 -0600, Dave Peterson
wrote:

Why not just use your if/then/else statement.

For i=strt To stp
if not isnumeric(cells(i,j)) then
'do nothing
else
'do lots of things
end if
next i



wrote:

Is there a VBA statement that will caus a loop to immediately do the next
iteration? For example:

sub x()
.....
For i=strt To stp
if not isnumeric(cells(i,j)) then goto Lbl
...
...
Lbl:
Next i

I would like to avoid the goto and say:
if not isnumeric(cells(i,j)) then NextIteration

Thanks for any help