Running a Macro When a Workbook Is Opened

Running a Macro When a Workbook Is Opened

One advantage of writing Excel macros in VBA is that you can have Excel run a macro whenever a workbook is opened. For example, if you use a worksheet for presentations, you can create macros that render the contents of selected cells in bold type, italics, or different typefaces to set the data apart from data in neighboring cells. If you should close a workbook without removing that formatting, however, the contents of your workbook will have highlights when you open it. While this is not a catastrophe, returning the workbook to its original formatting will take only a few seconds to accomplish.

Rather ...

Get Microsoft® Office Excel® 2003 Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.