for each loops

  • Thread starter Thread starter adncmm1980
  • Start date Start date
A

adncmm1980

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

:rolleyes: :eek: :confused: :confused
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top