Adding User Form Code

In general, VBA programmers add two types of code to a UserForm module: event code that underlies the various controls on the form (and perhaps the form itself) and additional procedures that perform utility functions needed by the application. The latter code is added to the general section of the UserForm code module.

To illustrate the point with a very simple example, suppose we want to create an application that sorts selected columns (treating each column as a single object) using the first row as the sort key. Our form might look something like the one shown in Figure 14-2.

0 0

Post a comment