Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default newbie: stop a FOR NEXT loop

how can I jump out of a for next loop before I get to the top of the series
of numbers?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default newbie: stop a FOR NEXT loop

If <condition Exit For


"Mike H" wrote in message
...
how can I jump out of a for next loop before I get to the top of the

series
of numbers?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default newbie: stop a FOR NEXT loop

Check out Exit in the online help; it's used for this situation (Exit For)
as well as others (Exit Do, Exit Sub, Exit Function, etc.).
--
HTH -

-Frank Isaacs
Dolphin Technology Corp.
http://vbapro.com


"Mike H" wrote in message
...
how can I jump out of a for next loop before I get to the top of the

series
of numbers?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default newbie: stop a FOR NEXT loop

Rethink your loop control.

Maybe you should not be using a for next loop - maybe a do while
loop would be better.

Chrissy.



"Mike H" wrote in message ...
how can I jump out of a for next loop before I get to the top of the series
of numbers?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default newbie: stop a FOR NEXT loop

for each cell in Range("A1:A200")
if isempty cell then exit for
' code to execute
Next


for i = 1 to 1000
if [test condition] then exit for
' code to execute
Next i

--
Regards,
Tom Ogilvy

Mike H wrote in message
...
how can I jump out of a for next loop before I get to the top of the

series
of numbers?




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
Stop a loop when certain data is found jsmith Excel Discussion (Misc queries) 3 June 2nd 08 10:12 PM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
VBA Newbie: Help with Do Loop code Carl Excel Discussion (Misc queries) 3 December 2nd 04 07:04 PM
Newbie. Please help me find a loop solution Nigel Brown[_3_] Excel Programming 1 July 16th 03 02:48 PM
Newbie. Please help me find a loop solution Nigel Brown[_2_] Excel Programming 0 July 16th 03 10:25 AM


All times are GMT +1. The time now is 05:09 PM.

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

About Us

"It's about Microsoft Excel"