Application Events

The Workbook_BeforePrint event is triggered when the workbook in which it resides is printed. If you wanted to run the same code in every workbook available, you would have to copy the code to each workbook. Or, you could use an application event, Workbook_BeforePrint, which is triggered when any workbook is printed.

The application events already exist, but a class module must be set up first so that they can be seen. To create a class module, follow these steps:

1. Insert a class module into the project. Rename it to something that will make sense to you, such as clsAppEvents.

0 0

Post a comment