Microsoft Office Tutorials and References
In Depth Information
This procedure sets various properties of the ScrollBar controls by using values based on the
When the ScrollBarZoom control is used, the ScrollBarZoom_Change procedure (which
follows) is executed. This procedure sets the ScrollBar control’s Value to the ActiveWindow’ s
Zoom property value. It also changes a label to display the current zoom factor.
Private Sub ScrollBarZoom_Change()
.Zoom = ScrollBarZoom.Value
LabelZoom = .Zoom & “%”
Worksheet scrolling is accomplished by the two procedures that follow. These procedures set the
ScrollRow or ScrollColumns property of the ActiveWindow object equal to the
appropriate ScrollBar control value.
Private Sub ScrollBarColumns_Change()
ActiveWindow.ScrollColumn = ScrollBarColumns.Value
Private Sub ScrollBarRows_Change()
ActiveWindow.ScrollRow = ScrollBarRows.Value
Rather than use the Change event in the preceding procedures, you can use the
Scroll event. The difference is that the event is triggered when the ScrollBars are
dragged — resulting in smooth zooming and scrolling. To use the Scroll event, just
make the Change part of the procedure name Scroll .
The ListBox control is extremely versatile, but it can be a bit tricky to work with. This section
contains of a number of examples that demonstrate common techniques that involve the
In most cases, the techniques described in this section also work with a ComboBox