Copy Cells down to Specific Row

shinobi

Board Regular
Joined
Oct 4, 2005
Messages
81
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a row of 3 cells with different formulas in them. I'd like to select that row of cells and then copy down to a specific row (defined by the last row of information in a table to the left).

So, for example, I have a table with hard coded data in it from cells A1 to C10. To the right of this, I have three cells that reference that data (D1 to F1). I'd like to copy D1:F1 down to row 10. The original table may change in size, so I can't hard code row 10 as the end point for copying - this needs to be variable.

Can anyone help me do this in my macro using VBA?

Thanks!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
See if this does what you want:
VBA Code:
Sub MyCopy()

    Dim lr As Long
    
'   Find last row in column A with data
    lr = Cells(Rows.Count, "A").End(xlUp).Row
    
'   Copy formulas from D1:F1 down to last row
    Range("D1:F1").Copy Range("D2:D" & lr)
    
End Sub
 
Upvote 0
Solution
You are welcome.

Hope it makes sense.
Let me know if you have any questions about it.
 
Upvote 0

Forum statistics

Threads
1,214,399
Messages
6,119,279
Members
448,884
Latest member
chuffman431a

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