Fill Down In VBA

TMackie

New Member
Joined
Dec 13, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I am working on a Macro to copy down the Formulas from the top row to the last row without calling the specific ending cell as it changes each week.

After running the macro to put the formula into "A7" the next line of code is as follows:

Range("A7").FormulaR1C1 = stringName
LastRow = Range("C2000").End(xlUp).Row
Range("A7:A" & LastRow).Value = stringName

However, this just deletes out what is in cell "A7".

Column C will be the reference point as to what the final cell will be, and will never be over 2000 rows.

What do I need to change to allow for the formula to be copied down?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
If stringName is a formula have you tried just changing
VBA Code:
Range("A7:A" & LastRow).Value = stringName
to
VBA Code:
Range("A7:A" & LastRow).FormulaR1C1= stringName
 
Upvote 1
VBA Code:
LastRow = Range("C2000").End(xlUp).Row
Range("A7:A" & LastRow).FillDown
 
Upvote 1

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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