Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Skip a section in a For Next loop

Status
Not open for further replies.

leonepaolo

Programmer
May 28, 2001
82
0
0
CA
Hi!

When Something = False I want to skip the balance of the code within my For Next loop.

Right now I'm using a GoTo SkipToNext but I was told that GoTo commands shouldn't be used like this. I'm also not crazy about how the "SkipToNext:" flushes left in this instance.

Any suggestions or comments are greatly appreciated.

Thanks in advance,
Paolo.
 
Howdy leonepaolo . . .

. . . and this:
Code:
[blue]   For x = 1 To 1000
      [green]'
      'Beginning Code
      '[/green]
      If Something = True Then
         [green]'
         'Balance of Code
         '[/green]
      End If
   Next[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hey TheAceMan1!

Well that was nice and simple now wasn't it. I just love one line "If" statements, those nasty "End If"'s just get in my way.

Thanks for the headshake.

Until next time,
Paolo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top