Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Expanding Ranges of Numbers Automatically

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    Here is the problem.

    I have ranges of numbers. I need to explicitly state the numbers contained within the range. Here is an example

    Col A | Col B

    1 10
    34 50
    67 80

    Through some Excel Magic the resulting data set would like this.

    1
    2
    3
    .
    .
    .
    10
    34
    35
    36
    .
    .
    .
    50
    etc
    etc
    etc

    Thanks !
    Saadi




  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try the following:

    Dim start, finish, counter As Integer
    For h = 1 To 3
    start = Range("a" & h)
    finish = Range("b" & h)
    For i = start To finish
    counter = counter + 1
    Range("C" & counter).Value = (i)
    Next i
    Next h

    Change the "3" in "h=1 to 3" to the number of series that you want to fill.

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    Thanks for the advice.
    I ended up writing a formula that would add one to a start number until it was = to the very last number that I wanted to reach.

    This filled in the range for me.

    Saadi

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •