Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Loop Problem

I have a construct like this:

Do While Yadda Yadda
If More Yadda Then
If Still More Yadda Then
Loop
End If
End If
Loop

Now, obviously that inner "Loop" can't fire because it can't find a matching
"Do", but I don't want to fire off an "Exit Do" because that sends me outside
the Do..Loop, where some core numeric variables are set, and that isn't what
I have in mind <g!

So, how do I get to the top of the Do..Loop from that inner location?
--
Dave
Temping with Staffmark
in Rock Hill, SC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Loop Problem

give the last loop a label, like Continue:
then instead of your Loop, use Go To Continue:
Do While Yadda Yadda
If More Yadda Then
If Still More Yadda Then
GoTo Continue
End If
End If

Continue:
Loop


"Dave Birley" wrote:

I have a construct like this:

Do While Yadda Yadda
If More Yadda Then
If Still More Yadda Then
Loop
End If
End If
Loop

Now, obviously that inner "Loop" can't fire because it can't find a matching
"Do", but I don't want to fire off an "Exit Do" because that sends me outside
the Do..Loop, where some core numeric variables are set, and that isn't what
I have in mind <g!

So, how do I get to the top of the Do..Loop from that inner location?
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Loop Problem

Aaaaah, yes! Was the first language we old farts ever learned BASIC, where
GoTo was a way of life? I even had a time where I played with C and C++, and,
once again GoTo was okey-dokey. But for most of the past 20+ years, I have
lived in the Visual FoxPro environment, where GoTo hath no home, so I never
thought of such a simple solution.

Thankee for bringing me into the fold <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Bob Umlas, Excel MVP" wrote:

give the last loop a label, like Continue:
then instead of your Loop, use Go To Continue:
Do While Yadda Yadda
If More Yadda Then
If Still More Yadda Then
GoTo Continue
End If
End If

Continue:
Loop


"Dave Birley" wrote:

I have a construct like this:

Do While Yadda Yadda
If More Yadda Then
If Still More Yadda Then
Loop
End If
End If
Loop

Now, obviously that inner "Loop" can't fire because it can't find a matching
"Do", but I don't want to fire off an "Exit Do" because that sends me outside
the Do..Loop, where some core numeric variables are set, and that isn't what
I have in mind <g!

So, how do I get to the top of the Do..Loop from that inner location?
--
Dave
Temping with Staffmark
in Rock Hill, SC

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
For Loop Problem Brian Matlack[_75_] Excel Programming 2 May 15th 06 09:59 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
Problem with Do Loop and If aehan Excel Programming 7 April 8th 05 01:01 AM
Problem with Loop Mike Excel Programming 7 February 26th 04 09:12 PM
For..Next loop problem Dwaine Horton Excel Programming 1 February 18th 04 12:12 AM


All times are GMT +1. The time now is 06:10 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"