Set the SpinButton Min/Max and current value : SpinButton « Forms « VBA / Excel / Access / Word






Set the SpinButton Min/Max and current value

 

Private Sub UserForm_Initialize()
    With SpinButton1
        .Min = 1
        .Max = 100
        Label1.Caption = "Specify a value between " & .Min & " and " & .Max & ":"
'       Initialize Spinner
        .Value = 1
'       Initialize TextBox
        TextBox1.Text = .Value
    End With
End Sub

 








Related examples in the same category

1.Set Spinner value to a TextBox
2.Assign value from a TextBox to a Spinner
3.The spin button control uses the SpinDown and SpinUp events to decrease and increase the value in cell B4
4.Spin up event procedure for spin button