Microsoft Office Tutorials and References
In Depth Information
Understanding UserForm Events
Occurs when the control detects an error and can’t return the error
information to a calling program.
Occurs immediately before a control loses the focus to another control on the
Occurs when the user presses a key and the object has the focus.
Occurs when the user presses any key that produces a typeable character.
Occurs when the user releases a key and the object has the focus.
Occurs when the user clicks the lower (or left) SpinButton arrow.
Occurs when the user clicks the upper (or right) SpinButton arrow.
A user can operate a SpinButton control by clicking it with the mouse or (if the control has the
focus) by using the up-arrow and down-arrow keys.
When the user clicks the upper SpinButton arrow, the following events occur in this precise order:
Enter (triggered only if the SpinButton did not already have the focus)
The user can also press Tab to set the focus to the SpinButton and then use the arrow keys to
increment or decrement the control. If so, the following events occur (in this order):
SpinUp (or SpinDown )
What about changes via code?
The SpinButton control can also be changed by VBA code — which also triggers the
appropriate event(s). For example, the following statement sets the SpinButton1 Value property to 0
and also triggers the Change event for the SpinButton control — but only if the SpinButton
value was not already 0 :
SpinButton1.Value = 0