Use relative references

See under “Relative references“. It’s a button on the code section of the “Developer tab” that you might decide to hit before you start the “Macro recorder“:

  • If you hit “Use relative references” the “Macro” you record will start working from the “Active cell” in your spreadsheet i.e. the Excel cell your cursor is in when you later “Run” the macro.
  • If instead you don’t click the “Use relative references” button when you are recording then you will end up creating slightly different code. When you play the macro back later the code will start running from the same cell each time.

To summarise:

  • Use relative references = macro code starts running from the active cell.
  • Don’t hit the relative references button and the macro code starts running from same cell each time (= the cell you were in when you recorded the macro).
    Under the definition for “Select” we’ve got some examples of code recorded with relative references turned both on and off.

User forms

U also stands for user forms: customised “Input boxes“. It’s a big subject and we have tried to get you started by taking you through an example getting to the point where we have a user form working.

Macros coverage from the financial modelling course

You’re looking at the macros glossary from our course material covering the use of macros in Excel financial modelling.

...join the conversation...

Your email address will not be published. Required fields are marked *