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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,224,827
Messages
6,181,197
Members
453,022
Latest member
RobertV1609

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