Skip to main content
by learnformula
Explore courses
search
For Business
Team license & compliance management
For Higher Education
Academic partnerships
For Government Agencies
Government training solutions
For Instructors & Course Creators
Teach on our marketplace
Become a Sponsor
Reach professionals where they learn
Log inStart 7-Day Free TrialStart Free TrialStart Free Trial
search
Explore courses
arrow_backBack to Latest Intelligence

Why Does Your Excel Macro Keep Going Back to the Same Cell?

Billy Wigley•Nov 25, 2026•3 min read
Share
SIGN UP AND GET
10% OFF
Sign up for our newsletter and get 10% off your next purchase!
By subscribing, I agree to LearnFormula's email marketing. I can unsubscribe anytime. See Privacy Policy.

You record an Excel macro to highlight an invoice. It works on row 5. Then you try it on row 12, and Excel highlights row 5 again. What happened?

The Macro Recorder remembered where you clicked. If you want the macro to work from wherever you start, record it with Use Relative References turned on.

Fixed address or starting point?

Say your invoice amounts are in column C and you want to highlight a status cell two columns to the right, in column E.

  • Fixed (absolute): You record selecting E5. The macro goes back to E5, even if you start in C12.
  • Relative: You start in C5 and record moving two cells to the right. Start in C12 next time and the same move takes you to E12.

Both are useful. Use a fixed address when you always want to format the same cell, like A1 on a template. Use relative recording when the row changes but the layout stays the same.

Try it in a practice workbook

  1. In desktop Excel, select C5 before you start recording. On the Developer tab, turn on Use Relative References, then choose Record Macro.

    Excel Developer tab with Use Relative References turned on and cell C5 selectedStart in C5 and turn on Use Relative References.

  2. Press the Right Arrow twice to move to E5, apply a fill color, then choose Stop Recording.
  3. Select C12 and run your macro from Developer → Macros. Check that the new fill appears in E12.

    Excel worksheet showing yellow fill in E5 and E12, with E12 selectedStarting the macro in C12 highlights E12. E5 still has the fill from the original recording.

Try it on one more row. The habit to build is checking where you start and which cell actually changes before you use the macro on your real workbook.

This exercise uses the VBA Macro Recorder in desktop Excel. Excel for the web can open a workbook that contains VBA macros, but it can’t record or run them. To keep your practice macro, open Save As and choose Excel Macro-Enabled Workbook (*.xlsm) under Save as type.

Excel Save As dialog with Excel Macro-Enabled Workbook (*.xlsm) selected under Save as typeIn Save As, choose Excel Macro-Enabled Workbook (*.xlsm).

Keep building your Excel skills

On my LearnFormula profile, open Level Up Your Excel Skills: Macros and look for “Unlocking the Power of Relative References in Macros.” This course is 1 CPD hour. Check that it meets your professional development requirements.

Don’t get mad…get skills! 🤙

Tags:
  • Excel Automation
  • BASIC EXCEL WORKBOOKS
  • MICROSOFT EXCEL
  • EXCEL VBA