Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Loop to Next item in For Next on Condition

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Loop to Next item in For Next on Condition

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

" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Loop to Next item in For Next on Condition

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

--
Regards,
Tom Ogilvy


" wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop Until non-incrementing cell condition met. GBExcel via OfficeKB.com Excel Worksheet Functions 3 November 4th 09 07:47 PM
To find rate of each item from item.xls and to copy price.xls pol Excel Discussion (Misc queries) 7 July 16th 09 12:49 AM
Item numbers result in item description in next field in Excel Cheryl MM Excel Worksheet Functions 1 February 20th 07 03:51 PM
Loop until a condition is False matt_steer[_3_] Excel Programming 1 May 18th 04 03:41 PM
two-condition loop Jamie Martin[_2_] Excel Programming 0 October 6th 03 11:47 PM


All times are GMT +1. The time now is 07:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"