How to Use VBA FillDown to Copy Excel Formulas Down
Question details
The user needs to automate the process of copying formulas from a specific top row into subsequent rows using a VBA macro to avoid repetitive copy-and-paste actions.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating repetitive spreadsheet tasks by populating a large range of cells with formulas from the first row of that range.
- Observed behavior
- The user wants to execute a single VBA command that copies row L4:S4 down to L23, preserving relative cell references automatically.
Ensure that the Developer tab is enabled in your spreadsheet application and that you have saved a backup copy of your workbook before running new VBA macros.
Use the VBA FillDown Method
The FillDown method is the most efficient way to copy formulas or data from the top row of a specified range into all the rows below it.
By applying FillDown to a specific range, the method automatically takes the contents of the very first row in that range and copies it down to the bottom. It perfectly mirrors the behavior of manually dragging the fill handle, ensuring that all relative cell references are updated correctly.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
Click on 'Insert' in the top menu and select 'Module' to create a blank script window.
Type the following macro: Sub CopyFormulas() Range("L4:S23").FillDown End Sub This code instructs the program to look at the top row (L4:S4) and fill its formulas down to row 23.
Press F5 or click the Run button on the toolbar to execute the macro and populate your formulas.

Use Copy and PasteSpecial for Values and Formats
If you want to remove the formulas and only keep the calculated values and number formats, using PasteSpecial is the preferred alternative.
Automate Data Processing with WPS Spreadsheet Macros
WPS Office provides excellent support for macros and VBA, allowing you to run scripts like FillDown seamlessly to automate your workflow without requiring heavy manual work.
- 1. Install WPS Office: Download and install the free WPS Office suite on your computer.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet and open your macro-enabled workbook.
- 3. Access the Developer Tools: Navigate to the Developer tab on the ribbon to access the built-in VBA Editor.
- 4. Run Your Code: Paste your Range.FillDown VBA script and execute it to automatically copy your formulas.

Frequently Asked Questions
Does VBA FillDown preserve relative cell references?
Yes, just like dragging the fill handle in the regular spreadsheet interface, the VBA FillDown method automatically updates relative cell references for each subsequent row it copies into.
What happens if there are blank cells in the destination range before using FillDown?
The FillDown method will overwrite any existing data, including blank cells, in the specified destination range with the formulas or values pulled from the top row.
Why use FillDown instead of a VBA Copy and Paste loop?
FillDown executes as a single, built-in operation. This makes it significantly faster, requires less code, and uses less system memory than writing a VBA loop to copy and paste row by row.




