Just building a bit further on dominic's suggestion:
If you want the spin button to be visible and applied only to a specific range of cells then you can use this code. The spinner will be visible when the activecell is in the range(A2:A10) and hidden if not.
Option Explicit
Private Sub SpinButton1_SpinDown()
With ActiveCell
.Value = .Value - 1
End With
End Sub
Private Sub SpinButton1_SpinUp()
With ActiveCell
.Value = .Value + 1
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A2:A10")) Is Nothing Then
With Me
.SpinButton1.Visible = True
.SpinButton1.Left = Target.Offset(0, 1).Left
.SpinButton1.Top = Target.Top
End With
Else
Me.SpinButton1.Visible = False
End If
End Sub
Bookmarks