logo
search
VBA & Macro Problems

How to Use VBA FillDown to Copy Excel Formulas Down

Kushani NimanthikaKushani Nimanthika Sep 27, 2026 869 views

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.

How to Use VBA FillDown to Copy Excel Formulas Down
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.

2
Insert a New Module

Click on 'Insert' in the top menu and select 'Module' to create a blank script window.

3
Enter the FillDown Code

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.

4
Run the Macro

Press F5 or click the Run button on the toolbar to execute the macro and populate your formulas.

Use the VBA FillDown Method
Reference Preservation: The FillDown method automatically preserves relative cell references while keeping absolute references locked, just as standard Excel formulas do.

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. 1. Install WPS Office: Download and install the free WPS Office suite on your computer.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheet and open your macro-enabled workbook.
  3. 3. Access the Developer Tools: Navigate to the Developer tab on the ribbon to access the built-in VBA Editor.
  4. 4. Run Your Code: Paste your Range.FillDown VBA script and execute it to automatically copy your formulas.
Fully compatible with Microsoft Excel macro-enabled workbooks (.xlsm)Native support for VBA scripts to automate complex repetitive tasksLightweight architecture for faster execution of large data calculationsFamiliar user interface makes transitioning from other office suites seamless
QA img-9

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.