Continuing with the subject of using macros in your Excel workbooks, we are going to look at Executing Macros Automatically this week.
There are times when you may wish to have a recorded macro perform automatically whenever your workbook is opened (or closed). Let’s say, for instance, that you have a Customer Service Report workbook that you routinely access to update how the department is progressing. If you know that you are going to want a particular macro to run each time you open the workbook, you can automate the process with a very simple piece of VBA code.
All that is needed to have your workbook update whenever it is opened is to name your macro, Auto_Open (or Auto_Close if you want it to run when the workbook is closed…). It really is as simple as that!
But, what if occasionally you do not want to have the macro execute? Merely hold down
when opening or closing your workbook to suppress the
Automating Macros: Easily accomplished with a simple renaming of your macro.