+ Reply to Thread
Results 1 to 4 of 4

for - next statement

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    Detroit
    MS-Off Ver
    Excel 2003
    Posts
    2

    for - next statement

    Hi all,

    is there a way to use the for next statement and exclude some numbers.

    For example

    for i = 1 to 18 (and) 25 to 30 (and) 40 to 73.
    .
    .
    .
    .
    next i

    That it runs from 1 to 73, but skip the 19to24 and 31to39.
    Thx, jan

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,251

    Re: for - next statement

    Try this
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,134

    Re: for - next statement

    You can "cheat"

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    09-16-2010
    Location
    Detroit
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: for - next statement

    thank you, it works pretty good...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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