Chapter 41: Creating UserForms
847
Creating the UserForm
If you’re following along on your computer, start with a new workbook. Then follow these steps:
- Choose Developer ➪ Visual Basic (or press Alt+F11) to activate the VB Editor
window. - In the VB Editor Project window, double-click your workbook’s name to activate it.
- Choose Insert ➪ UserForm. The VB Editor adds an empty form named UserForm1
and displays the Toolbox. - Press F4 to display the Properties window and then change the following properties
of the UserForm object:
Property Change To
Name AboutBox
Caption About This Workbook
- Use the Toolbox to add a Label object to the UserForm.
- Select the Label object. In the Properties window, enter any text that you want for
the label’s Caption. - In the Properties window, click the Font property and adjust the font. You can
change the typeface, size, and so on. The changes then appear in the form. Figure 41.8
shows an example of a formatted Label control. In this example, the TextAlign prop-
erty was set to the code that center aligns the text.
2 - fmTextAlignCenter
FIGURE 41.8
A Label control, after changing its Font properties.