Search and Find

 

 

 

 

By Sections

 

 

 

 

By Levels

 

 

 

 

Other Links

 

 

Lesson 3-10: Spin Buttons

In the toolbox the spin  button  has this icon   VBA for Excel spin buttons icon.

You can ask a user to enter a value directly in a text box but you can make things a little fancier by using a text box and a spin button.

The spin button is not really used by itself. Because the spin button doesn't show its value it is usually used with a text box. The text box shows a number and by clicking on the arrows of the spin button the value in the text box is increased (or decreased) by 1, or 5 or 10...by whatever value set within the properties of the spin button.

Properties

The other interesting properties of the spin buttons  are:

- Min is the minimum value of the spin button. It can be negative
-
Max is the minimum value of the spin button. It can be negative
- Small  Change is the value of the change when the user clicks on the arrows
- TabIndex is a property that you change through the "Tab Order" functionality as shown in the UserForms lesson.

Code

On the "Change" event of the spin button you will have code modifying the value of the text box that accompanies it:
tbxInput=spbInput


The spin buttons allows you to create userforms that are more efficient than with text boxes and "sexier": vba-form-spin-button.xls
(1 of 25)

                 
       

Developed and Presented by PLI Consultant Inc