Code to select range and fill down

erock24

Well-known Member
Joined
Oct 26, 2006
Messages
1,161
I am working on a macro and I need to go to the bottom of a range that starts at D3 then over to F. So, I have this
Code:
Range("D3").Select
    Selection.End(xlDown).Offset(0, 2).Select

But then I need to select F:I and fill down the formulas in F3:I3.
I know it will be some kind of Range(Selection, Selection.End(xlUp)).Select
Selection.FillDown. I don't know how to put it all together.
Thank you for your time and help.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
You should not need to Select anything.

Exactly what do you want to do?
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Code:
LR = Cells(Rows.Count, "D").End(xlup).Row
Range("F3:I" & LR).FillDown
 

erock24

Well-known Member
Joined
Oct 26, 2006
Messages
1,161
I figured it out:

Code:
Range("F3:I3").AutoFill Destination:=Range("F3:I" & Range("D" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault

seems to do the trick.
cool!!
 

Forum statistics

Threads
1,181,658
Messages
5,931,271
Members
436,786
Latest member
Deniel

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
Top