Microsoft Office Tutorials and References
In Depth Information
Inserting form controls and setting form properties
Inserting form controls and setting form
properties
UserForms are Excel objects that you create to provide a user-friendly interface for data
entry. You can allow open-ended text entry by adding a text box, define specific items in a list
box, or combine the two approaches in a combo box.
To create a UserForm, press Alt+F11 to open the Visual Basic Editor, and then on the Insert
menu, click UserForm. You can then change the form’s name by clicking in the Properties
pane and entering a new value in the Name field.
You can change the size of a UserForm by dragging any of the handles on its sides or
corners. By dragging a handle in the middle of a side, you can change the UserForm’s height or
width; dragging a handle at a UserForm’s corner changes both height and width.
TIP The Name property is the internal representation of the UserForm (that is, how you will
refer to it in your code), so you should consider putting the letters frm at the start of the
name to indicate that it represents a form.
The Caption property contains the word or words that appear on a UserForm’s title bar. To
change the UserForm’s caption, click the UserForm and then, in the Properties panel, click
the box next to the Caption property and edit its value.
Adding text boxes to UserForms
You can create a text box in a UserForm so that users can enter textual information. If the
Toolbox isn’t displayed in the Visual Basic Editor, on the Insert menu, click Toolbox. Then
click the TextBox button in the Toolbox and drag in the body of the UserForm to define the
text box. When you do, the text box’s properties appear in the Properties panel.
As with the UserForm object, you can change the name of a text box. To do that, click
the text box control and then, in the Properties pane, enter a new value in the Name
property’s box.
12
 
Search JabSto ::




Custom Search