VBA & Macro Problems

How to Use Excel VBA FormulaR1C1 to Multiply by a Fixed Cell

Olivia MillerOlivia Miller Oct 28, 2026 869 views

Question details

The user needs to use Excel VBA to automatically multiply values in a relative column by a specific fixed cell, and perform subsequent relative column-to-column multiplications.

How to Use Excel VBA FormulaR1C1 to Multiply by a Fixed Cell
Product
Excel
Device & OS
not provided
Scenario
Automating spreadsheet calculations with VBA where a constant multiplier (like a tax rate or conversion factor stored in cell H11) must be applied to moving column data.
Observed behavior
The user requires the correct R1C1 syntax to reference a fixed absolute cell and relative column cells simultaneously in VBA.
Before you start

Ensure that the Developer tab is enabled in your spreadsheet software and that you have basic familiarity with the Visual Basic Editor.

Solution 1Recommended

Use Absolute and Relative R1C1 References in VBA

Apply fixed row and column numbers (R11C8) for the constant cell and bracketed numbers (RC[2]) for the relative columns to ensure the formula scales properly.

The FormulaR1C1 property is highly efficient for applying identical formulas across a range in VBA. In this notation, using 'R' and 'C' followed by standard numbers creates an absolute reference (a fixed cell). Adding square brackets creates a relative reference based on the active cell's position.

1
Identify the Relative Source Cell

Determine the relative offset for your first formula. If the target cell is in column E and you are pulling data from column G, column G is 2 columns to the right. The relative R1C1 reference is RC[2].

2
Construct the Fixed Cell Reference

Convert your fixed cell (H11) to absolute R1C1 format. 'H' is the 8th column, so H11 becomes R11C8. It has no brackets, meaning it will not change when applied to multiple rows.

3
Write the First Formula

Select your target cell in column E via VBA and apply the formula: ActiveCell.FormulaR1C1 = "=RC[2]*R11C8".

4
Write the Second Formula for Column Multiplication

To multiply column D by column E and place the result in column F, calculate the relative offsets from column F. Column D is two columns left (-2) and E is one column left (-1). Apply the formula: ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]".

Use Absolute and Relative R1C1 References in VBA
Understanding VBA R1C1 Offsets: A number enclosed in brackets indicates an offset from the active cell. Positive numbers move down (for rows) or right (for columns), while negative numbers move up or left. Omitting the brackets entirely creates an absolute, fixed reference.
Advanced Macros in WPS Spreadsheet

Automate Complex Calculations with WPS Spreadsheet

WPS Office fully supports advanced formulas, macros, and R1C1 reference styles, allowing you to streamline complex calculations effortlessly and run your VBA scripts smoothly.

  1. 1. Enable Developer Tools: Open your spreadsheet in WPS Office and navigate to the Developer tab.
  2. 2. Open Visual Basic Editor: Click on 'Macros' or 'Visual Basic' to launch the integrated code editor.
  3. 3. Insert the R1C1 Code: Insert a new module and paste your ActiveCell.FormulaR1C1 VBA code with the fixed and relative references.
  4. 4. Execute the Macro: Run the macro to instantly populate the multiplied values accurately across your target columns.
Fully compatible with Microsoft Excel macro formats (.xlsm)Free and lightweight alternative for daily spreadsheet tasksIntuitive Developer tab for easy macro recording and VBA editingSupports both A1 and R1C1 formula reference styles seamlessly
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between Formula and FormulaR1C1 in Excel VBA?

The 'Formula' property uses the standard A1 reference style (e.g., '=G2*$H$11'), while 'FormulaR1C1' uses numerical row and column offsets (e.g., '=RC[2]*R11C8'). FormulaR1C1 is highly preferred in VBA loops because the exact formula string can be applied to an entire range simultaneously without needing string concatenation for row numbers.

How do I make a row absolute but a column relative in R1C1?

To fix the row but allow the column to change dynamically, omit the brackets on the row number and include them on the column offset. For example, 'R11C[2]' locks the reference permanently to row 11, but continually references two columns to the right of wherever the active cell is located.

Why is my VBA FormulaR1C1 returning an application-defined error?

This error usually occurs if the R1C1 string syntax is malformed. Common causes include missing quotation marks around the formula, unbalanced brackets, or referencing a relative column/row offset that extends beyond the boundaries of the spreadsheet (such as RC[-100] when in column A).