$$Excel-Macros$$ Re: Escaping a foir loop

2009-07-29 Thread vivek agrawal
thanks for all the replies... does Excel VBA have a substitute command for "Continue" .. Thanks and Regards, Vivek Agrawal Skype ID - vivek.agrawal83 GoogleMoonlight.com - Saving energy-Save Earth On Wed, Jul 29, 2009 at 4:43 PM, Daniel wrote: > Hi. > > > > Randomize >

$$Excel-Macros$$ Re: Escaping a foir loop

2009-07-29 Thread Raju A
Hi Vivek, Please find below the piece of code requested. Val = 4 For i = 1 To 1000 If Val < 10 Then Exit For End If MsgBox i Next Regards Raju On Wed, Jul 29, 2009 at 4:24 PM, vivek agrawal wrote: > Hi ALL > Can anybody please tell me how to Escape a for loop ... > > f

$$Excel-Macros$$ Re: Escaping a foir loop

2009-07-29 Thread zheng yu
use GOTO there is no statement such as Continue in VBA for i=1 to 1000 if i=5 then goto NextLoop ' other code NextLoop: next i On Wed, Jul 29, 2009 at 2:47 PM, vivek agrawal wrote: > Hello Kumaran > Exit For would completely exit from the for loop.. > > i want it to skip the code for th

$$Excel-Macros$$ Re: Escaping a foir loop

2009-07-29 Thread danielc
Randomize For i = 1 To 1000 Var = Rnd * 10 If Var < 5 Then GoTo myNext 'next instructions myNext: Next i or Randomize For i = 1 To 1000 Var = Rnd * 10 If Var >= 5 Then 'next instructions End If Next i Daniel On

$$Excel-Macros$$ Re: Escaping a foir loop

2009-07-29 Thread vivek agrawal
Hello Kumaran Exit For would completely exit from the for loop.. i want it to skip the code for the current loop and iterate to the next loop Thanks and Regards, Vivek Agrawal Skype ID - vivek.agrawal83 GoogleMoonlight.com - Saving energy-Save Earth On Wed, Jul 29, 2009 at 4:45 PM, OfficeVb

$$Excel-Macros$$ Re: Escaping a foir loop

2009-07-29 Thread Daniel
Hi. Randomize For i = 1 To 1000 Var = Rnd * 10 If Var < 5 Then Exit For Next i 'next instructions Regards. Daniel From: excel-macros@googlegroups.com [mailto:excel-mac...@googlegroups.com] On Behalf Of vivek agrawal Sent: mercredi 29 juillet 2009 12