LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Exit two loops at once


Is it possibble to exit two for loops at once?

I have some code like this

Sub INCC()
Set rng = ActiveSheet.UsedRange.Cells
For c = 1 To rng.Columns.Count
For r = 1 To rng.Rows.Count
If something Then
Some code here....
Exit For
End If
Next r
If something Then Exit For
Next c
more code here.....
End Sub

Now I was wandering if its possible to exit both loops if the condtion in
the inner loop is met, without having to test again in to leave the outer
loop.

Jan


 
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
Exit Field vs Exit Button...... roy_ware Excel Programming 2 October 10th 07 04:05 PM
"Continue" and Exit with For Loops Andrew Hall NZ Excel Programming 4 November 23rd 06 02:44 AM
Loops... Willabo Excel Discussion (Misc queries) 2 June 14th 06 04:08 PM
do loops saravanan Excel Worksheet Functions 0 June 13th 06 10:53 AM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM


All times are GMT +1. The time now is 08:38 AM.

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"