Today, we will talk about absolute and relative references in macros as well as different ways to run our macro.
Today, we are going to record a macro, where we will put the TODAY function. However this time, we will press ENTER instead of the Ctrl + Enter shortcut. We can start with cell A5. Let’s use the Record button located in the status bar tab this time instead of using the Developer tab (Fig. 1)

Let’s call our macro ‘Today2’. We dont’t need any shortcut but let’s try to add a shortcut here by clicking the Ctrl + D combination and see what happens later on. We want to save our macro in the Personal Macro Workbook. When we press OK, Excel won’t allow us to save our macro, because we already have a macro with this shortcut. Let’s delete the shortcut then. When we use a shortcut that already exists in Excel, macro shortcut for macro will be more important than the default shortcut, e.g. Ctrl key. Thus, we shouldn’t use such kind of shortcuts. Let’s press OK (Fig. 2)

Now, we just write TODAY in cell A5. It’s important that the Use Relative References isn’t highlighted (Fig. 3)

After we finished writing TODAY, let’s press ENTER. After writing the formula, we can see that Excel went down one cell by default. Now, we just press STOP on the status bar (Fig. 4)

After we stopped our macro, how can we run it now? We can go to the Developer tab and press the View Macros command or just click the Alt + F8 key shortcut (Fig. 5)

In the window that has appeared, we can see all available macros, which are in All Open Workbooks. Now, we have only two. We can see that before the macro name, we have the file name. We can choose macros from many files (Fig. 6)

For us, it’s important to run the Today2 macro, so let’s select it and press the Run button (Fig. 7)

Excel has written the TODAY function in our selected cell, which is C5 and has gone to cell A6 (Fig. 8)

Let’s try a similar thing with the firs macro. Let’s press Alt + F8 shortcut, select the Today2 macro and press RUN. Now, let’s see what exactly our macro has done. Let’s press Alt + F11. We should see our first macro and our new macro Today2, as well as some comments (Fig. 9)

Let’s delete the comments as we don’t need them and let’s locate the lines so that they are clearer to read. Now, we have two lines of the code. The first line of the Today2 macro is very similar to the Today macro. However, instead of ‘Selection’, we have ‘ActiveCell’. It means that our formula is written in the active cell. After the line that contains our macro, Excel will always go to cell A6, We can see it in the next line of ‘Range (“A6”). Select. ‘Select’ means the action, i.e. that we have selected the cell (Fig. 10)

This is how macros are working. If we select a range, the TODAY function will be placed only in the active cell. Then, Excel will go to cell A6.
Let’s try a similar macro. The only difference is that this time we will be using relative references. So let’s do it once again: click on the Record Macro button (1), let’s call it Today3 (2), This Workbook (3) and press OK (4) (Fig. 11)

We’re writing everything once again: TODAY function in cell A7 (1), then Enter (2), then the Stop Recording button (3) (Fig. 12)

This time we were using relative references. Let’s press Alt + F11. Where is our macro? It’s not in the PERSONAL.XLSB file but in our Macro file, where we record. It means that we have to find Modules (1), where Module 1 should be added (2). Let’s double-click it and we can see our macros (Fig. 13)

We don’t need comments so let’s delete them again. Let’s also adjust the size of the windows so that we can see it clear. We have the TODAY 2 and TODAY 3 functions here. We’ve found our macro (Fig. 14)

There is one more way to find our macros. Let’t go to the Developer (1) tab and go to the View Macros button (2). In the window that appeared we can see that we have many options there like Run, Step into, Edit, Delete and Options (3). For our macro, the Options button is the most significant one, because here we can see shortcuts for our macro (4) (Fig. 15)

If we delete D, this macro will delete the shortcut if I press OK. However, we’re not going to do that. Let’s close the Macro Options window and let’s focus on the Today3 macro. Since this file is still open, we don’t see any names before. Let’s go to the Edit option of this macro (Fig. 16)

This option leads us to the exact window our macro is stored. The first line in the Today3 macro is exactly the same as in Today2 macro. However, the second line is totally different. First of all, both lines start with ‘ActiveCell’. Then, we have Offset (1, 0) — by one row and 0 columns. It means that we went one cell down. Then, VBA tells us that we selected Range A1. In fact, we didn’t select A1 or any other cells. Sometimes, it’s hard to understand VBA due to some inputs. It’s true that we didn’t select A1, but when we went one cell down from the active cell, we selected a range that is the same size as range A1 cell.
Once again. First we start with Active Cell, then there is a dot, which means that we take another step, then choosing the Offset, one row, 0 columns, then we have the Range A1 and what we do with this range, which is selecting the range (Fig. 17)

Let’s go back to our worksheet and select cell A8, then go once again to our macro by clicking Alt + F11. This time, we press Play (Run Sub) in our VBA editor or F5 as a shortcut (Fig. 18)

What we notice here is that Excel has written the Today function in cell A8 and went one cell below (Fig. 19)

Let’s select a range this time and press F5 (Fig. 20)

What we’re noticing is that the value has been written only in the active cell, although we had selected the whole range. Then, Excel went one cell down (Fig. 21)

Summing up, there is a small difference between relative and absolute references, but still, we have to consider whether we want to use the first one or the second.