Code to autofill to the last line

AgentMeow99

New Member
Joined
Oct 15, 2015
Messages
19
I wish I was good at code, but sadly I am not. I am sure this one is SUPER EASY for you guys... I want to enter 1 into cell A15, 2 in cell A16, select a15 & a16 then autofill the subsequent numbers 1...whatever through to the last line that has data in column b. This is the last few lines where that code is. Can someone help me fix it, please???

Range("A15").Select
ActiveCell.FormulaR1C1 = "1"
Range("A16").Select
ActiveCell.FormulaR1C1 = "2"
Range("A15:A16").Select
Selection.AutoFill Destination:=Range("A15:A34")
Range("A15:A34").Select

THANK YOU!!!
 

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.
Try this.
Code:
    Range("A15").Value = 1
    Range("A15:A" & Range("B" & Rows.Count).End(xlUp).Row).DataSeries Rowcol:=xlColumns, Type:=xlChronological, Date:= _
        xlDay, Step:=1, Trend:=False
 
Upvote 0

Forum statistics

Threads
1,226,739
Messages
6,192,739
Members
453,754
Latest member
milestogo

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