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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

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