Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Advancing to the next iteration of a loop?

I can't find any way to advance a loop in VB. It won't let you put a NEXT
anywhere by the bottom, and I can see anything like "continue" or "next for".
Is this feature really missing??!?

Maury
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Advancing to the next iteration of a loop?

What kind of loop??? A Do/Loop??? Post an example of your code.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Advancing to the next iteration of a loop?

You just have to do something like this:

Sub a()
Dim Counter As Integer
For Counter = 1 To 10
If Counter = 5 Then GoTo NextLoop
Debug.Print Counter
NextLoop:
Next
End Sub


--
Jim
"Maury Markowitz" wrote in
message ...
|I can't find any way to advance a loop in VB. It won't let you put a NEXT
| anywhere by the bottom, and I can see anything like "continue" or "next
for".
| Is this feature really missing??!?
|
| Maury


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Advancing to the next iteration of a loop?

"Jim Rech" wrote:
You just have to do something like this:


Ewwwwww. No wonder people whine about this language.

Well the good news is I wasn't just being dumb.

Maury

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Advancing to the next iteration of a loop?

How's a 'Continue' or a 'Next for' or whatever any better than a goto?
All of them violate the basic premise of good programming: every block
of code must have a single entrypoint and a single exit point. One can
always use If...Then block. If the nested code is reasonably large use
or more subroutines.

Every language has its own set of compromises and limitations. If one
is so inclined there is something to whine about *every* language ever
developed. ;-)

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
"Jim Rech" wrote:
You just have to do something like this:


Ewwwwww. No wonder people whine about this language.

Well the good news is I wasn't just being dumb.

Maury


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
Advancing the year JT Excel Discussion (Misc queries) 5 August 20th 09 07:24 PM
Advancing Timing lsmft Excel Discussion (Misc queries) 2 April 9th 06 04:04 PM
Advancing Down A List Minitman Excel Worksheet Functions 6 December 6th 05 02:44 AM
Iteration loop Brad[_20_] Excel Programming 2 May 28th 04 03:11 PM
Iteration loop Brad[_20_] Excel Programming 0 May 28th 04 01:31 PM


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