In this post, we will see where our macro is saved.
Let’s go to the Developer tab. On the left, we can see the Visual Basic command. We can also press the Alt + 11 shortcut. So, let’s click it. Now, in the worst case scenario, all we would see is a grey window. In this case we need some more information. Let’s turn on a smaller window by opening the View menu, and select the Project Explorer command (Fig. 1)

What we should see here is all Excel files that are opened, as well as our PERSONAL.XLSB files, which are our personal files for macros (Fig. 2)

In each file, we should also see some worksheets and similar things, especially modules. Our code should be written as Module 1 by default. Before we click on it, let’s go to the View tab one more time and click on the Properties Window command (Fig. 3)

This window shows us information about files or worksheets (Fig. 4)

Let’s go now to Module 1. After double-clicking on it, we should have a small window opened. Our first macro was very simple, however we have more rows than we need. We don’t need the Option Explicit line, so let’s delete it. Next, we have the Sub key word which starts our macro and the phrase End Sub which stops it. Only the elements that are between those two lines create our macro. Our macro is called TODAY. The other time I mentioned that the TODAY function is a DZIŚ function in Polish, however no matter what version I have on my computer, VBA is American and will use American names and procedures in macros. When we look at our macro, we can see the line with the TODAY function, as well as a few green lines starting with green single quotation marks. They are just comments. In VBA, comments start with a single quotation mark, and are not part of the VBA code (Fig. 5)

Having the above in mind, I can just delete them and leave only the line that is an actual VBA code. Now, it’s quite simple when you read it. ‘Selection’ means that we just selected something, a dot means the next step after selecting. Then, we have the Formula, which means that we put a formula. The R1C1 isn’t important for us. Then, our formula equals the TODAY function. That is the whole VBA code (Fig. 6)
