Excel > Excel 2007 Advanced > Macros

Relative References in Macros

By default when referencing a cell in a macro, Excel uses absolute cell references.

For example, with a macro recording from cell B4, we click on cell B5. When we run the macro from cell H2, Excel would move to cell B5 again.

Using relative references in a macro it would have moved to cell H3 as H3 is in the same relative position to H2 as B5 is to B4.

So by default Excel macros accept the cell reference literally, or what is known as absolute i.e. clicking on cell B5 means B5. With relative references the cell reference is used in relation to the active cell. In the example just given B5 is one cell below B4. So when run in H2 it moves one cell down to H3.

To ensure the macro uses relative references:

  1. Click the View tab
  2. Click Macros and then click Use Relative References

Selecting Relative References

Follow us on

Facebook  Twitter  You Tube