• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 30. Creating Interactive Excel A... > Automatic Execution of VBA Code

Automatic Execution of VBA Code

In some instances, you may want Excel to start your code when you open the workbook that contains it. Perhaps the workbook is an expense report form that contains some VBA code to help the user complete the form. When the workbook opens, you may want the code to start so that the user doesn't have to start it separately.

Some procedures can run automatically through the use of events. An event is a predetermined occurrence to which you can attach code that will run when that occurrence takes place. For example, each workbook has an Open event. Code that's attached to the Open event will run when the workbook is opened. Here's how to make your code run automatically using the Open event:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint