Join Curt Frye for an in-depth discussion in this video Running a procedure when you open, close, or save a workbook, part of Up and Running with VBA in Excel.
- View Offline
- Exercise Files
When you create a business solution using Excel macros, you gain the ability to…influence your users' actions;…for example, you can display a welcome message when the workbook opens, verify…a workbook's integrity before it's closed, and examine the workbook's contents before it's saved.…Each of these event-handling routines help ensure your workbook will function…the way you want it to.…For example, let's say that I want it to display a welcome message whenever…a workbook is opened.…If I were to open the Manipulateworkbook, Excel displays a message saying…Welcome to the Commission Tracking workbook.…
I click OK, and then press Alt+F11 to go to my code module, so that you can…see how I did that.…The Auto_Open event, or macro, is actually a holdover from Excel 4, which used a…different macro language, but so many programmers used it that the Excel…product team kept it in.…Notice that unlike other event handlers, the Auto_Open subroutine actually is in…a General module, as opposed to either Sheet1 or, because this is workbook…
- Working in the Visual Basic Editor
- Adding code to a macro
- Creating, exporting, and deleting code modules
- Declaring and using variables
- Managing variable scope
- Defining arrays
- Managing workbooks and worksheets with VBA
- Repeating tasks with loops
- Debugging VBA code
- Cutting, copying, and pasting cell data
- Running and triggering event procedures
Skill Level Advanced
1. Introducing Visual Basic for Applications (VBA)
2. Defining Variables, Constants, and Calculations
3. Adding Logic to Your VBA Code
4. Debugging Your VBA Code
5. Managing Workbook Elements and Data in VBA
6. Adding Advanced Elements to Your Workbook
7. Using Excel Events in Your VBA Code
8. Putting It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.