Autofill xldown offset three columns

Bench

Board Regular
Joined
Aug 27, 2009
Messages
134
Hi,

I've used the following formula many times to autofill to the last row based upon the adjacent column

Code:
Range("D5").AutoFill Destination:=Range("D5", Range("D5").Offset(0, -1).End(xlDown).Offset(0, 1))

For the code i'm currently writing Column's B & C will always have gaps in their data, therefore it needs to autofill based upon Column A, i've tried various modifications to try and accomplish but without success. Sure it's something fairly simple.

Your thoughts would be appreciated

Thanks

Ben
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Range("A" & Rows.Count).End(xlUp)

This gives the bottom cell in column A. You should be able to use that with an Offset to achieve your goal,
 
Upvote 0
This will fill column C based on Column A

Code:
Range("C5").AutoFill Destination:=Range("A5", Range("A5").End(xlDown)).Offset(0, 2)

Or this...
Code:
Range("C5").AutoFill Destination:=Range("C5", Range("A5").End(xlDown).Offset(0, 2))
 
Last edited:
Upvote 0
Range("A" & Rows.Count).End(xlUp)

This gives the bottom cell in column A. You should be able to use that with an Offset to achieve your goal,

Thanks, i'm still quite a beginner with VBA so not sure exactly how to execute that in code :(

Been playing a bit more and have come up with the below, this is so close to working, just fills down one short of where it needs to be.

Code:
Range("D5").AutoFill Destination:=Range("D5", Range("D5").Offset(0, -1).End(xlDown).Offset(4, 1))
 
Upvote 0
thanks for your help folks, this one worked for me in the end

Code:
Range("D5").AutoFill Destination:=Range("D5", Range("A5").End(xlDown).Offset(-1, 3))
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,163
Members
448,554
Latest member
Gleisner2

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