Duration
2 days
Objectives
Enable delegates to start developing Excel-based applications, using VBA:
- Familiarise with the VBA Editor and environment
- Learn to write code in the VBA language
- Explore the Excel object model and the Excel VBA library.
Prerequisites
Delegates should have experience of using Excel to a good intermediate level, being familiar with the use of named ranges, database-type worksheets, lookup functions, etc.
Topics
- Introduction: Why VBA?
- The VBA Editor
- Project Explorer
- Code Window
- Immediate Window
- Object Libraries & the Object Browser
- A First Procedure
- Getting Code from Elsewhere
- VBA Code
- More on Variables & Types
- Control constructs: conditionals, loops
- Procedures: subs and functions
- Comments, etc.
- Debugging
- Setting breakpoints
- Debug Mode
- Locals and Watch windows
- The Excel object model
- Workbook, Worksheet, Range, etc.
- Collections and object references
- Custom Functions
- Making functions available in formulas
- Programming Excel Forms
- Designing a Form
- Form Properties
- Form and Control events
- Controlling Controls
- Using Forms
- A data input Form
- Form initialization
- Adding data to Worksheets
- Controls on Worksheets
- Error Handling
- Accessing Multiple Workbooks
- Data consolidation example
|