What are Relative References?
In Excel, the way of recording actions within a macro that is relative to the cell or range that the macro starts from is known as a relative reference. When you start recording a macro with relative reference, Excel records the actions based on the position of the active cell at the beginning of the macro. The recorded actions will adjust accordingly when the macro is run on different ranges.
Relative References in Excel Macros
We have two options to refer a cell in Excel VBA Absolute references and Relative references. Default Excel records macro in Absolute mode.
In this article, we learn about Relative references in Excel VBA. We select a cell “A1”, turn on “Use Relative Reference” and record a macro to type some text in cells B2:B4.
Since we turn on the “Relative reference” option. Macro considers the number of rows and columns from active cells. In our example, we select cell A1 and start type B2, which is to move one column and one row from A1 (Active cell).