Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default for each loops


Dear all

If you have more than one for each loop in a procedure, how can I ge
my procedure to loop back to the first loop instead of the last.

Regards

Andrew

:confused

--
adncmm198
-----------------------------------------------------------------------
adncmm1980's Profile: http://www.excelforum.com/member.php...fo&userid=1496
View this thread: http://www.excelforum.com/showthread.php?threadid=26604

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default for each loops

AFAIK, the VB language does not support it. Use a flag to determine the
exit. e.g.:

dim bExit as boolean
bExit = false
For each a in as_collection
for each b in bs_collection
If [condition to exit] Then
bExit = True
Exit For
End If
next b

If bExit = True then
Exit For
End If
Next a


HTH,
Nacho

"adncmm1980" wrote in message
...

Dear all

If you have more than one for each loop in a procedure, how can I get
my procedure to loop back to the first loop instead of the last.

Regards

Andrew




--
adncmm1980
------------------------------------------------------------------------
adncmm1980's Profile:

http://www.excelforum.com/member.php...o&userid=14965
View this thread: http://www.excelforum.com/showthread...hreadid=266040



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
loops???? harry buggy Excel Worksheet Functions 2 August 14th 07 06:33 PM
Loops SaraJane Excel Discussion (Misc queries) 11 May 26th 07 04:47 AM
Using For - Next Loops in VB Biomed New Users to Excel 4 March 22nd 05 07:12 PM
Loops Snow[_2_] Excel Programming 2 May 13th 04 09:48 PM
help with loops Rick B[_6_] Excel Programming 8 January 28th 04 12:32 AM


All times are GMT +1. The time now is 02:27 AM.

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

About Us

"It's about Microsoft Excel"