# AutoFill a Column

#### pdieppa

##### New Member
Hi there

This is my first post; hopefully it will not be my last as I see there is very good information here!

I have a simple request from one our remote offices.

C2 Contains either a single or three character letter
D2 contains a number
E2 contains a number

I need to combine the letter(s) with the number (C2 & D2) to become one and autofill A column with sequential numbers up to the value of E2.

Example:

If I type E in C2 and 1000 in D2 and 200 in E2, I need 200 numbers like this:

E1000
E1001
E1002
...
E1200

I'll be attaching this code to a button.

Percy

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
=C2&D2&ROW()

For a macro, try:
Code:
``````Sub Combine()
Dim Ltr As String, Num As Long, lRow As Long

Ltr = Range("C2").Value
Num = Range("D2").Value
lRow = 1
For Num = Num To Range("E2").Value
Cells(lRow, "A").Value = Ltr & Num
lRow = lRow + 1
Next Num

End Sub``````

You can also try
Code:
``````Dim FillRange As Range

Set FillRange = Range("G1")
Set FillRange = FillRange.Resize(Range("E2"))
FillRange.Item(1, 1).Select
FillRange.Formula = "=\$C\$2&(\$D\$2+ROW()-ROW(" & _
FillRange.Item(1, 1).Address & "))"
FillRange.Copy
FillRange.PasteSpecial xlPasteValues
Application.CutCopyMode = False``````

Just change Range("G1") to the proper range to copy the data.

Replies
1
Views
174
Replies
3
Views
228
Replies
9
Views
2K
Replies
15
Views
939
Replies
0
Views
229

1,196,249
Messages
6,014,229
Members
441,808
Latest member
xplainer

### 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?

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