Testing the macro
It's all very well to have recorded a macro, but how do we know whether it's working or not? There is only one way, and that is to test it. Sure, you can have a look at the VBA code in the VBA Editor, but unless you are a seasoned coder, it will be virtually impossible to find coding errors. Best then to do a practical test.
Getting ready
Before moving on, make sure that you have recorded the macro as per the instructions in the previous recipe. We will be using that code in this recipe.
Since we've previously used Sheet1 to record the macro, we will have to test it on Sheet2. Testing on Sheet1 will have no effect because the cells have already been formatted. Sheet2 is still in its original form, meaning we will immediately notice any changes.
How to do it…
Let's proceed with the following steps:
- Make sure that
02_RecordMacro.xlsx
is still open, but this time on Sheet2. To test how effective the Relative Reference...