+ Reply to Thread
Results 1 to 2 of 2

culling consecutive numbers from an array

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    dallas
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question culling consecutive numbers from an array

    Hi everyone

    I'm new to this forum, and I'm working in a project with vba and I having a problem Culling consecutive numbers from an array as depicted below:

    there are 4 ranges of numbers

    range A- 1 to 24
    range B- 33 to 56
    range C- 287 to 310
    range D- 330 to 353

    the array giving can contain any combination of numbers between the 4 ranges above, example as below:

    1
    2
    3
    4
    5
    8
    22
    23
    24
    33
    34
    35
    40
    287
    288
    290

    the result would be something like :

    RangeA: 1-5,8,22-24
    RangeB: 33-35,40
    RangeC: 287-288,290
    RangeD: Nothing

    I'll really appreciate for any help!

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: culling consecutive numbers from an array

    Hi

    See how this goes
    Please Login or Register  to view this content.
    This will put the output into column B.


    rylo
    Last edited by rylo; 08-16-2012 at 09:04 PM. Reason: updated code

+ 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