+ Reply to Thread
Results 1 to 6 of 6

Continue next iteration of For loop

  1. #1
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Continue next iteration of For loop

    After a particular line executes, I want the next iteration of the for loop to take place. I have read that there is a continue statement. Some websites say "continue" or "continue for" but neither are working. For now I am trying to insert 'continue' after "Case 1."



    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Continue next iteration of For loop

    Hi,

    I'm not sure what you mean by a 'Continue' statement. I know of no such syntax in VBA. What exactly are you wanting to happen?

    Once a Case statement is acted upon the program flow is then to the End Select line.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Continue next iteration of For loop

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    I'm not sure what you mean by a 'Continue' statement. I know of no such syntax in VBA. What exactly are you wanting to happen?

    Once a Case statement is acted upon the program flow is then to the End Select line.
    After the case statement executes, I want to jump over the IF statement below it, and go straight to the 'next' statement so that the next iteration of the loop can take place right away.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Continue next iteration of For loop

    Do you mean the If statement should be avoided only if Case 1 processes.

    If so why not use the ColNo variable in another IF Test just before the current If Test.

    i.e.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Continue next iteration of For loop

    Quote Originally Posted by Richard Buttrey View Post
    Do you mean the If statement should be avoided only if Case 1 processes.

    If so why not use the ColNo variable in another IF Test just before the current If Test.

    i.e.

    Please Login or Register  to view this content.

    If Case 1 is true, I want the program to jump over the IF statement below the Case and just go to the next iteration. I like the way it is set up now in terms of readability, I just need to find out how to start the next iteration.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,621

    Re: Continue next iteration of For loop

    Please Login or Register  to view this content.
    NOTE: Please do not quote whole posts (Rule #12)
    Last edited by protonLeah; 12-22-2013 at 02:13 AM.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro Loop Broken. Detects Max but doesn't continue loop
    By herchenbach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2011, 12:17 PM
  2. Loop Array Iteration and Processing
    By Bigced_21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2010, 11:16 AM
  3. Selection not updating after 1st iteration in a For Each loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2009, 09:19 PM
  4. For Loop STOPS at Random Iteration!
    By wjoc1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2007, 09:58 AM
  5. Advancing to the next iteration of a loop?
    By Maury Markowitz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2005, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1