Expanding Ranges of Numbers Automatically

Saadi

New Member
Joined
Apr 7, 2002
Messages
2
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
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top