VBA to copy formula to last row of adjacent cell

Steven101

Board Regular
Joined
Oct 27, 2014
Messages
62
Hi, I have a list of names in column D, each name is repeated 8 times.

I have formula in columns F:CM. Columns F is the only one that has a merged cells (F3:F11 are merged, and repeated down column F) , so that instead of showing the name 8 time it only shows once.

I'm trying to create a macro to copy the formula I have in F3:CM3 all the way down to the last row of data in column D

I can create a lastrow count, however when I try ."FillDown" nothing happens.

Code:
Sub Copy_Formula()
'
' Copy_BAU_Formula Macro
'
'
Dim lastR As Long
'FIND LAST ROW OF DATA IN COLUMN 4 (D)
lastR = Cells(Rows.Count, 4).End(xlUp).Row

'COPY FROM ROW 3 OF COL 6 (F) TO LAST ROW OF COLUMN D IN COLUMN 91 (CM)
Range(Cells(3, 6), Cells(lastR, 91)).FillDown
Calculate
End Sub

Any help would be appreciated

Thanks S
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Since column F has merged cells, you may have to do that columns separately from the rest (if column F will work at all).
Note that merged cells are VERY problematic for things like VBA, sorting, etc. For that reason, most serious programmers do not use them. They cause more problems than they solve.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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