Introduction to Parallel Project: Trip Planner
The following series of lessons and exercises is designed to demonstrate the Excel VBA coding methodology taught in the main course. These lessons complement and reinforce the main course. Links to relevant main course lessons are found throughout the parallel project. The parallel project can be worked through at the same time you are going through the course-ware, or it can be done after you have finished the main course, depending upon your learning preference.
The parallel project consists of building an Excel front-end for trip planning (see screenshot below). The front-end is staged on an Excel worksheet. You may see, as you go through the lessons, that the front-end could also have been presented as a wizard using a series of dialogs. We used an Excel worksheet instead of user dialogs (e.g. userforms) in order to show the process flow more clearly and to show what you can do directly on an Excel worksheet. (How to create and code userforms is covered in Chapter 6 of the main course. An example of a dialog-driven wizard built with userforms is demonstrated in Chapter 8 of the main course.)
"Start on the Same Page" Using Workbook Downloads
At key points during the parallel project, you can download an Excel workbook that is complete up to that point in the parallel project. This allows you to start with a workbook that is correct in case you had unresolved errors in your work during the just-finished section.
Summary of Techniques and VBA Code in the Parallel Project
Following are the main workbook setup and coding techniques you will learn in the Trip Planner parallel project:
- Set up an Excel workbook for use as an application front-end, including formatting, custom toolbars, and sheet naming and organization.
- Create, format, align, and code controls on a worksheet.
- Use the VB Editor Property and Project panes and insert code modules.
- VB Editor variable declaration using DefTypes and Option Explicit.
- Write VBA code:
- Set object variables that refer to control objects like list boxes.
- Fill a list box with code.
- Trigger code when a list box selection is changed.
- Find the last row with a value in a column on a worksheet.
- Capture the selection from a list box.
- Capture multiple selections from a multiple-select list box.
- Modify the properties of a list box and button during run time.
- Handle an error.
- Delete items from a list box using code.
- Using Excel SpecialCells method for looping.
- Working with option buttons (i.e., "radio" buttons).
- Decision making using If...Then, If...Then...ElseIf, Select Case.
- Concatenating strings.
- Building an Excel formula on-the-fly and plugging it into the worksheet.

|
Click here for feedback and questions about this chapter.
Copyright © 2006-2008 J. Donald McClenagan, PhD, ALL RIGHTS RESERVED
|
|