VBA - Last row & Autofill

LeeBillington

Board Regular
Joined
Dec 31, 2016
Messages
89
Hi,

So i am trying to find last column of B with data. then my current selection(Varies per day) to be autofilled down to the last column.

Not sure how to excecute it at all.

thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I am guessing that you want the last "row" in column B and not the last "column" as B is a column.

To find the last row

VBA Code:
Dim lr as long
lr = Range("B" & rows.count).end(xlup).row

You have not indicated what you wish to fill down. Are you copying the same value into all rows or is it a sequential number you wish to fill down?
 
Upvote 0
I am guessing that you want the last "row" in column B and not the last "column" as B is a column.

To find the last row

VBA Code:
Dim lr as long
lr = Range("B" & rows.count).end(xlup).row

You have not indicated what you wish to fill down. Are you copying the same value into all rows or is it a sequential number you wish to fill down?

Oh sorry, yes the last row of column B, and there will be data ill manually put into the selection of like 5 cells, (formula in the selection and that needs to be autofilled down to the last row of B)
 
Upvote 0

so im using this,
Selection.AutoFill Destination:=Range("B6:B" & Range("E" & Rows.Count).End(xlUp).Row)
Range(Selection, Selection.End(xlDown)).Select

and i keep getting the error.. autofill method of range class failed.
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,554
Members
448,970
Latest member
kennimack

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