+ Reply to Thread
Results 1 to 6 of 6

how to skip an instance in a loop

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Smile how to skip an instance in a loop

    If instead of running a loop from 1 to 10, is there a simple way to change they syntax to run it from 1 to 5 and 7 to 10 or or would I have to run two loops now?
    So looking for something similar to this:
    Please Login or Register  to view this content.
    instead of this:
    Please Login or Register  to view this content.
    Thanks
    Last edited by luv2glyd; 12-09-2015 at 01:04 PM.
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: how to skip an instance in a loop

    Maybe
    Please Login or Register  to view this content.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    11-18-2015
    Location
    Madrid
    MS-Off Ver
    2016
    Posts
    95

    Re: how to skip an instance in a loop

    Hi, a conditional in between could work:

    Please Login or Register  to view this content.
    excelbat.com: free Excel tools, macros...

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: how to skip an instance in a loop

    Here's a suggestion:

    Please Login or Register  to view this content.
    or:

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: how to skip an instance in a loop

    Another:

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: how to skip an instance in a loop

    Ok, looks like a conditional is the way to go. Thanks everyone.

+ 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. Skip in loop if condition in loop is met
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2015, 10:41 AM
  2. [SOLVED] For loop - skip to next cell in range
    By gombi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2014, 04:43 PM
  3. [SOLVED] Skip row in For...Next loop to automate e-mails
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-15-2013, 08:26 AM
  4. [SOLVED] Skip blank cells in a loop
    By k64 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-14-2013, 02:29 PM
  5. Use a loop but skip a row
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2013, 12:26 PM
  6. How to skip special cases in a For Each loop
    By smohyee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2011, 02:20 PM
  7. Changing the condition of a For Each loop for a single instance
    By akh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-23-2010, 11:23 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