Macro to create series of number using a start and end number

ispi2071

New Member
Joined
Feb 22, 2019
Messages
2
Hoping someone can assist me doing this little faster using a Macro or script.

I know I can type a starting number in any given cell. Then I can click Fill > Series > Select Columns and enter the Stop Value and Excel will build the series for me. I am looking for a faster way of doing this where I can enter the start number in cell A1 and the end number in cell B1. I would like the Macro/script to build the series starting in cell A2 and stop at the value in B1 using step value 1.

The reason I need done is I have a set of numbers from another application that only gives me the start and end value of ranges of numbers. I have about 500 different ranges and don't want keep doing Fill > Series > over and over.

Hope someone can guide me.

Thanks
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,509
Try:
Code:
Sub FillSequentialNumbers()
    With Range("A2")
        .Value = Range("A1").Value
        .AutoFill Destination:=Range("A2").Resize(Range("B1").Value - Range("A1").Value + 1), Type:=xlFillSeries
    End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,500
Messages
5,523,288
Members
409,508
Latest member
Afc

This Week's Hot Topics

Top