18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using UserForm Controls in a Worksheet 42<br />

Image control<br />

An Image control is used to display an image.<br />

The following is a description of the most useful properties of an Image control:<br />

TIP<br />

n<br />

n<br />

AutoSize: If True, the Image control is resized automatically to fit the image.<br />

Picture: The path to the image file. Click the button in the Properties window, and Excel displays<br />

a dialog box so you can locate the image.<br />

Another way to display the image is to copy it to the Clipboard. Then, select the Picture<br />

property in the Properties window and press Ctrl+V. The advantage is that the image is stored<br />

with the workbook.<br />

Label control<br />

A Label control simply displays text. This control isn’t a very useful for use on worksheets, and a<br />

TextBox control (described later in this list) gives you more versatility.<br />

ListBox control<br />

The ListBox control presents a list of items, and the user can select an item (or multiple items). It’s similar<br />

to a ComboBox. The main difference is that a ListBox displays more than one item at a time.<br />

The following is a description of the most useful properties of a ListBox control:<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

NOTE<br />

BoundColumn: If the list contains multiple columns, this property determines which column<br />

contains the returned value.<br />

ColumnCount: The number of columns in the list.<br />

IntegralHeight: This is True if the height of the ListBox adjusts automatically to display full<br />

lines of text when the list is scrolled vertically. If False, the ListBox may display partial lines of<br />

text when it is scrolled vertically.<br />

LinkedCell: The worksheet cell that displays the selected item.<br />

ListFillRange: The worksheet range that contains the list items.<br />

ListStyle: Determines the appearance of the list items.<br />

MultiSelect: Determines whether the user can select multiple items from the list.<br />

If you use a MultiSelect ListBox, you can’t specify a LinkedCell; you need to write a<br />

macro to determine which items are selected.<br />

OptionButton control<br />

OptionButton controls are useful when the user needs to select from a small number of items.<br />

OptionButtons are always used in groups of at least two.<br />

The following is a description of the most useful properties of an OptionButton control:<br />

n<br />

n<br />

n<br />

Accelerator: A letter that lets the user select the option by using the keyboard. For example, if the<br />

accelerator for an OptionButton is C, pressing Alt+C selects the control.<br />

GroupName: A name that identifies an OptionButton as being associated with other<br />

OptionButtons with the same GroupName property.<br />

LinkedCell: The worksheet cell that’s linked to the OptionButton. The cell displays TRUE if the<br />

control is selected or FALSE if the control isn’t selected.<br />

741

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

Saved successfully!

Ooh no, something went wrong!