Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA equivalent of Javascript continue


Is there an equivalent of the continue used in javascript to skip a for
loop?

I have a number of if then conditions to be met and rather than nest
them I would prefer to skip to the next loop if the condition isn't
met.

ie:

For n = 1 to 10

If (condition1 = false) Then
' skip anything doesn't meet 1st criteria
' this is where I would use continue in javascript
End If

' If it gets to this point I know 1st condition has been met

If (condition2 = false) Then
' skip anything doesn't meet 2nd criteria
End If

' If it gets to this point I know 1st and 2nd conditions have been met

Next n


--
fazstp
------------------------------------------------------------------------
fazstp's Profile: http://www.excelforum.com/member.php...o&userid=30574
View this thread: http://www.excelforum.com/showthread...hreadid=502732

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default VBA equivalent of Javascript continue

Hi,

Try this:
---------------------------------------------------------------
For n = 1 to 10

If (condition1 = false) Then
Goto NextN
' skip anything doesn't meet 1st criteria
' this is where I would use continue in javascript
End If

' If it gets to this point I know 1st condition has been met

If (condition2 = false) Then
Goto NextN
' skip anything doesn't meet 2nd criteria
End If

' If it gets to this point I know 1st and 2nd conditions have been met

NextN: 'Don't forget the colon (:)

Next n
---------------------------------------------------------------

Pierre


"fazstp" a écrit dans
le message de ...

Is there an equivalent of the continue used in javascript to skip a for
loop?

I have a number of if then conditions to be met and rather than nest
them I would prefer to skip to the next loop if the condition isn't
met.

ie:

For n = 1 to 10

If (condition1 = false) Then
' skip anything doesn't meet 1st criteria
' this is where I would use continue in javascript
End If

' If it gets to this point I know 1st condition has been met

If (condition2 = false) Then
' skip anything doesn't meet 2nd criteria
End If

' If it gets to this point I know 1st and 2nd conditions have been met

Next n


--
fazstp
------------------------------------------------------------------------
fazstp's Profile:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default VBA equivalent of Javascript continue

for n=1 to 10

if condition1=true then
if condition2= true then
'do stuff
end if
end if

next n

Tim

--
Tim Williams
Palo Alto, CA


"fazstp" wrote in
message ...

Is there an equivalent of the continue used in javascript to skip a for
loop?

I have a number of if then conditions to be met and rather than nest
them I would prefer to skip to the next loop if the condition isn't
met.

ie:

For n = 1 to 10

If (condition1 = false) Then
' skip anything doesn't meet 1st criteria
' this is where I would use continue in javascript
End If

' If it gets to this point I know 1st condition has been met

If (condition2 = false) Then
' skip anything doesn't meet 2nd criteria
End If

' If it gets to this point I know 1st and 2nd conditions have been met

Next n


--
fazstp
------------------------------------------------------------------------
fazstp's Profile:

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



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
link javascript sureshkasi1985 via OfficeKB.com Excel Worksheet Functions 0 June 5th 08 11:47 AM
link javascript sureshkasi1985 via OfficeKB.com Excel Worksheet Functions 0 June 5th 08 11:44 AM
Javascript Question jmkratt New Users to Excel 1 August 22nd 06 09:02 AM
OWC need help loading and saving with javascript 54patman Excel Programming 0 August 14th 05 05:08 PM
VBA formulas in javascript smr78 Excel Programming 1 October 6th 03 04:19 PM


All times are GMT +1. The time now is 08:58 PM.

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"