Understanding macros
Macros are a popular form of automation with Microsoft Office—especially Excel. We seem to think that whenever there is any repetitive action, we should create a macro. That is incorrect. Repetitive actions usually mean that you are using an inefficient method/process/feature set.
Here is the recommended approach:
- Consider the repetitive activity.
- Find if there is a better way within the app itself.
- If you find a better way, check if that better method is repetitive.
a. If still repetitive, then write a macro (or try to automate it)
b. If not repetitive, problem solved
We saw many examples of this in Chapter 4, Intelligent Data Analysis, while learning about Power Query.
Macros are best suited for scenarios where you have a need but there is no feature in the app to satisfy that need. Adding missing but useful functionality using macros is out of the scope of this book. However, here are some macros that I have created...