18.11.2014 Views

Microsoft Office

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Part VI<br />

Programming Excel with VBA<br />

TABLE 41.2<br />

Control<br />

(continued)<br />

Description<br />

OptionButton<br />

ToggleButton<br />

Frame<br />

CommandButton<br />

TabStrip<br />

MultiPage<br />

ScrollBar<br />

SpinButton<br />

Image<br />

RefEdit<br />

Adds an option button (to allow a user to select from multiple options).<br />

Adds a toggle button (to control Boolean options).<br />

Adds a frame (a container for other objects).<br />

Adds a command button (a clickable button).<br />

Adds a tab strip (a container for other objects).<br />

Adds a multipage control (a container for other objects).<br />

Adds a scroll bar (to specify a value by dragging a bar).<br />

Adds a spin button (to specify a value by clicking up or down).<br />

Adds a control that can contain an image.<br />

Adds a reference edit control (lets the user select a range).<br />

CROSS-REF<br />

You can also place some of these controls directly on your worksheet. Refer to Chapter 42 for<br />

details.<br />

Changing the properties of a control<br />

Every control that you add to a UserForm has several properties that determine how the control looks and<br />

behaves. You can change some of these properties (such as Height and Width) by clicking and dragging<br />

the control’s border. To change other properties, use the Properties window.<br />

To display the Properties window, choose View ➪ Properties Window (or press F4). The Properties window<br />

displays a list of properties for the selected control. (Each control has a different set of properties.) If you<br />

click the UserForm itself, the Properties window displays properties for the form. Figure 41.7 shows the<br />

Properties window for a CommandButton control.<br />

To change a property, select the property in the Property window and then enter a new value. Some properties<br />

(such as BackColor) enable you to select a property from a list. The top of the Properties window<br />

contains a drop-down list that enables you to select a control to work with. You can also click a control to<br />

select it and display its properties.<br />

722

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!