From the course: Excel for Engineering Professionals

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Events: Automatically run VBA code

Events: Automatically run VBA code - Microsoft Excel Tutorial

From the course: Excel for Engineering Professionals

Events: Automatically run VBA code

- [Instructor] Process control systems of production plants have all sorts of alarms that sound or flash when something needs to be done. The temperature of batch reactor six may be too high, or injection molding C may be out of feed, or maybe the paint spraying booth is ready to receive the next car. In programming terms, we call these things events, and events can trigger actions. VBA also offers events. You can have code that responds to various different things. And I'll start with the workbook events. After opening your workbook, and maybe hitting the Alt + F11 function key to go to the VBA Editor, you can find the objects that belong to your Excel workbook under the category Microsoft Excel Objects. By clicking the little plus, we can expand them, and then by a double click, we can open the module that belongs to this workbook. Now there's a number of events that can be triggered when something happens with the…

Contents