Microsoft Office Tutorials and References
In Depth Information
Showing a UserForm
sHoWing A usErforM
To show a UserForm, you execute the VBA Show command in a statement having the syntax
UserFormName . Show . For example, if you had performed the same steps as you’ve seen in this
lesson to create the frmEmployees UserForm, you may have a simple macro like this to call the
If you’d like to see how the UserForm looks when it is called in the actual worksheet environment,
without having to write a formal macro for yourself, you can type frmEmployees.Show into the
Immediate window and press the Enter key. Figure 18-16 shows how you and your users will see the
WHErE doEs THE usErforM’s codE go?
This lesson introduced UserForms and led you through the steps to create a basic form that contains
various controls. In Lessons 19 and 20 you see examples of how those and other UserForm controls
are programmable with event-driven VBA code.
A UserForm is a class of VBA objects that has its own module. Similar to the notion that each
worksheet has its own module, each UserForm you add to your workbook will automatically be created