Excel Macro: Relative Reference
- Author: Excel Tips and Tricks from Pryor.com
- Categories:
- Tags:
- Share on:
Excel records Macros in absolute mode by default. In absolute mode, a Macro will start working in the same cell it was in when it was recorded. If, when it was recorded, A1 was the active cell, then it will return to A1 and begin working from there no matter which cell was selected prior to starting the Macro.
When you turn on Relative Reference before recording a Macro, it will start the Macro “relative” to whatever cell is currently selected. This makes the Macro more flexible.
Example:
If you start recording the Macro in Cell A6 and insert a row:
With Absolute Reference – no matter what cell is selected the Macro will always insert a row at Row 6.
VBA Code in Edit Mode:
With Relative Reference – the macro will insert a row relative to the cell selected. If Cell A9 is selected, the macro will insert a row at Row 9.
VBA Code in Edit Mode:
Click the Use Relative Reference button on the Developer tab to toggle relative reference on and off.
Choose a Seminar and Save $10
Microsoft® Excel® 2013: Beyond the Basics
1 Day
- CEU: 0.6
- CPE: 6
Team Training - Virtual or In-person
Microsoft® Excel® Basics
1 Day
- CEU: 0.6
- CPE: 6
Virtual Seminars:
-
Dec 2
-
Dec 4
-
Dec 5
-
+ 28 more dates