Range.FormulaR1C1 Property in Excel VBA

By Hemanta Sundaray on 2021-09-07

The FormulaR1C1 property helps us set the formula for the Range object using R1C1-style notation.

Sub Total()

' Adds the values at cell A1 & B1
Range("C1").FormulaR1C1 = "=SUM(RC[-2]:RC[-1])"

End Sub

Join the Newsletter