Excel 2010 Bible

(National Geographic (Little) Kids) #1

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:


  1. Choose Developer ➪ Visual Basic (or press Alt+F11) to activate the VB Editor
    window.

  2. In the VB Editor Project window, double-click your workbook’s name to activate it.

  3. Choose Insert ➪ UserForm. The VB Editor adds an empty form named UserForm1
    and displays the Toolbox.

  4. 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



  1. Use the Toolbox to add a Label object to the UserForm.

  2. Select the Label object. In the Properties window, enter any text that you want for
    the label’s Caption.

  3. 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.
Free download pdf