View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Running a For function in a For function

I'm not clear what you are trying to do (example code would be useful), but
perhaps the following code will get you started.

Dim XEQ2 As Boolean
Dim N As Long
Dim ExitFirst As Boolean

For N = 1 To 10
Debug.Print N
' set the value of ExitFirst to True to exit out of the
' first For loop.
If ExitFirst Then
' set XEQ2 to True to run the second loop.
XEQ2 = True
Exit For
End If
Next N

If XEQ2 = True Then
For N = 11 To 20
Debug.Print N
Next N
End If


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"C. Corodan" wrote in message
...
Hello,

I have a For function executing a loop. Inside this function, before it is
completed, I want to launch a new For function for a different loop.

Any ideas?