Loop to Next item in For Next on Condition

M

marston.gould

Is there a way to do the following:

For i = 1 to iEnd
If Array(i) = Value Then
Next i
Else
For j = 1 to jEnd
..
..
..
Next j
End If
Next i

I know I can't have the Next i in there twice.
 
B

Bob Umlas

For i=1 to iEnd
If Array(i) = abc then goto 1
...
Else
For j=1 to jEnd
...
Next j
End if
1:
Next i

Bob Umlas
Excel MVP
 
T

Tom Ogilvy

i = lbound(array)
do while i <= ubound(array)
if array(i) = array1(kk) then
j = i
do while array() = array1(kk)
j = j + 1
loop
msgbox "for value " & array1(kk) & vbnewline & _
"Start position is " & i & vbNewline
"End position is " & j
exit do
Loop
 
Top