+ Reply to Thread
Results 1 to 5 of 5

Need loop to continue instead of end

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Need loop to continue instead of end

    I have the following code:

    Please Login or Register  to view this content.
    This code launches an external program and does stuff based on the contents of each cell between s3 and s5000, assuming it doesn't hit a blank cell. If it hits a blank cell, it stops the macro.

    It works GREAT, except that when I wrote this, this piece was the last section, so it was fine for me to Exit Sub once it found a blank cell. However, I've changed the macro now to do other stuff afterwards, and I need it to continue on to the next piece of code once it hits a blank cell instead of doing the Exit Sub.

    I don't know the syntax for this though.

  2. #2
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Need loop to continue instead of end

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Need loop to continue instead of end

    Hi Lord Terrin,

    You could try changing the Exit Sub to GoTo 100 and after the End If and before the additional code, type 100:

    Regards,
    David

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need loop to continue instead of end

    Untested.

    Please Login or Register  to view this content.
    Last edited by AB33; 11-26-2013 at 06:40 PM.

  5. #5
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Need loop to continue instead of end

    Quote Originally Posted by slx View Post
    Please Login or Register  to view this content.
    This worked perfectly - thank you. It makes sense as I just want to stop the "For" loop from running.

+ 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. loop continue till last invoice (srv) no. in specific column.
    By amarjeet.it in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-01-2013, 03:58 PM
  2. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  3. 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
  4. [SOLVED] How to continue loop after deleting row?
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-10-2006, 09:00 AM
  5. continue statement in a loop
    By rozner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2005, 11:05 AM

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