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 />

If your worksheet contains more than one set of OptionButton controls, you must ensure<br />

that each set of OptionButtons has a different GroupName property. Otherwise, all<br />

OptionButtons become part of the same set.<br />

NOTE<br />

ScrollBar control<br />

The ScrollBar control is useful for specifying a cell value. Figure 42.6 shows a worksheet with three<br />

ScrollBar controls. These ScrollBars are used to change the color in the rectangle shape. The value of the<br />

ScrollBars determines the red, green, or blue component of the rectangle’s color. This example uses a few<br />

simple macros to change the colors.<br />

FIGURE 42.6<br />

This worksheet has several ScrollBar controls.<br />

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

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

Value: The current value of the control.<br />

Min: The minimum value for the control.<br />

Max: The maximum value for the control.<br />

LinkedCell: The worksheet cell that displays the value of the control.<br />

SmallChange: The amount that the control’s value is changed by a click.<br />

LargeChange: The amount that the control’s value is changed by clicking either side of the<br />

button.<br />

The ScrollBar control is most useful for selecting a value that extends across a wide range of possible<br />

values.<br />

742

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

Saved successfully!

Ooh no, something went wrong!