Excel Macro: Relative Reference

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.

Excel Macro Relative Reference - Image 1

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.

Excel Macro Relative Reference - Image 2

VBA Code in Edit Mode:

Excel Macro Relative Reference - VBA Code 1

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.

Excel Macro Relative Reference - Image 3

VBA Code in Edit Mode:

Excel Macro Relative Reference - VBA Code 2

Click the Use Relative Reference button on the Developer tab to toggle relative reference on and off.

PRYOR+ 7-DAYS OF FREE TRAINING


Courses in Customer Service, Excel, HR, Leadership, OSHA and more. No credit card. No commitment. Individuals and teams.


Choose a Seminar and Save $10:

Microsoft<small><sup>®</sup></small> Excel<small><sup>®</sup></small> Basics

Microsoft® Excel® Basics

Oct. 3

Central Time Zone

Oct. 5

Central Time Zone

Oct. 6

Eastern Time Zone

Oct. 11

Eastern Time Zone

Oct. 12

Central Time Zone

Oct. 13

Pacific Time Zone

Oct. 17

Eastern Time Zone

Oct. 18

Central Time Zone

Oct. 24

Pacific Time Zone

Oct. 26

Central Time Zone

Oct. 27

Eastern Time Zone

Oct. 31

Central Time Zone

Nov. 2

Pacific Time Zone

Nov. 3

Eastern Time Zone

Nov. 7

Eastern Time Zone

Nov. 8

Central Time Zone

Nov. 9

Pacific Time Zone

Nov. 14

Pacific Time Zone

Nov. 15

Eastern Time Zone

Nov. 17

Central Time Zone

Nov. 28

Eastern Time Zone

Nov. 30

Pacific Time Zone

Dec. 1

Central Time Zone

Dec. 5

Central Time Zone

Dec. 7

Eastern Time Zone

Dec. 8

Pacific Time Zone

Dec. 13

Central Time Zone

Dec. 15

Eastern Time Zone

Dec. 19

Pacific Time Zone

Dec. 20

Central Time Zone

Jan. 4

Eastern Time Zone

Jan. 5

Central Time Zone

Jan. 9

Central Time Zone

Jan. 11

Eastern Time Zone

Jan. 12

Pacific Time Zone

Jan. 17

Pacific Time Zone

Jan. 18

Central Time Zone

Jan. 19

Eastern Time Zone

Jan. 23

Eastern Time Zone

Jan. 24

Central Time Zone

Jan. 25

Pacific Time Zone

Microsoft<small><sup>®</sup></small> Excel<small><sup>®</sup></small>: Beyond the Basics

Microsoft® Excel®: Beyond the Basics

Oct. 4

Central Time Zone

Oct. 6

Central Time Zone

Oct. 7

Eastern Time Zone

Oct. 12

Eastern Time Zone

Oct. 13

Central Time Zone

Oct. 14

Pacific Time Zone

Oct. 18

Eastern Time Zone

Oct. 19

Central Time Zone

Oct. 25

Pacific Time Zone

Oct. 27

Central Time Zone

Oct. 28

Eastern Time Zone

Nov. 1

Central Time Zone

Nov. 3

Pacific Time Zone

Nov. 4

Eastern Time Zone

Nov. 8

Eastern Time Zone

Nov. 9

Central Time Zone

Nov. 10

Pacific Time Zone

Nov. 15

Pacific Time Zone

Nov. 16

Eastern Time Zone

Nov. 18

Central Time Zone

Nov. 29

Eastern Time Zone

Dec. 1

Pacific Time Zone

Dec. 2

Central Time Zone

Dec. 6

Central Time Zone

Dec. 8

Eastern Time Zone

Dec. 9

Pacific Time Zone

Dec. 14

Central Time Zone

Dec. 16

Eastern Time Zone

Dec. 20

Pacific Time Zone

Dec. 21

Central Time Zone

Jan. 5

Eastern Time Zone

Jan. 6

Central Time Zone

Jan. 10

Central Time Zone

Jan. 12

Eastern Time Zone

Jan. 13

Pacific Time Zone

Jan. 18

Pacific Time Zone

Jan. 19

Central Time Zone

Jan. 20

Eastern Time Zone

Jan. 24

Eastern Time Zone

Jan. 25

Central Time Zone

Jan. 26

Pacific Time Zone

Advanced Microsoft<small><sup>®</sup></small> Excel<small><sup>®</sup></small>-Macros, PivotTables, Charts and More

Advanced Microsoft® Excel®-Macros, PivotTables, Charts and More

Oct. 4

Central Time Zone

Oct. 5

Eastern Time Zone

Oct. 11

Central Time Zone

Oct. 12

Pacific Time Zone

Oct. 20

Central Time Zone

Oct. 21

Eastern Time Zone

Oct. 24

Central Time Zone

Nov. 2

Eastern Time Zone

Nov. 7

Central Time Zone

Nov. 10

Pacific Time Zone

Nov. 15

Central Time Zone

Nov. 17

Eastern Time Zone

Nov. 29

Pacific Time Zone

Nov. 30

Central Time Zone

Dec. 5

Eastern Time Zone

Dec. 9

Central Time Zone

Dec. 15

Eastern Time Zone

Dec. 21

Pacific Time Zone

Jan. 4

Central Time Zone

Jan. 9

Pacific Time Zone

Jan. 10

Eastern Time Zone

Jan. 17

Central Time Zone

Jan. 18

Eastern Time Zone

Jan. 26

Central Time Zone

Jan. 27

Pacific Time Zone

Related Excel® Articles

PRYOR+ 7-DAYS OF FREE TRAINING


Courses in Customer Service, Excel, HR, Leadership, OSHA and more. No credit card. No commitment. Individuals and teams.

Categories