+ Reply to Thread
Results 1 to 3 of 3

for-loop for non consecutive ranges

  1. #1
    Registered User
    Join Date
    05-21-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003 SP3
    Posts
    19

    for-loop for non consecutive ranges

    Good morning folks,

    normally a for loop would be defined as :
    Please Login or Register  to view this content.
    But what I am looking for would be one loop covering for example 1 to 10 and 16 to 20, as all these columns would require the same code to be run on them, whil the columns in 11 to 15 would need to be addressed diferently.
    Is this at all possible, or do I simply have to live with three loops (1-10, 11-15 and 16-20) instead of reducing their number?

    Sincerely yours
    John
    Last edited by grendel_42; 07-26-2010 at 06:00 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: for-loop for non consecutive ranges

    Hi grendel_42
    something like
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    05-21-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003 SP3
    Posts
    19

    Re: for-loop for non consecutive ranges

    That works like a charm

    All the time trying to rewrite the for statement while the solution was that simple.

    Thanks a lot.

+ 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