Assign value from a TextBox to a Spinner : SpinButton « Forms « VBA / Excel / Access / Word






Assign value from a TextBox to a Spinner

 
  Private Sub TextBox1_Change()
      Dim NewVal As Integer

      NewVal = Val(TextBox1.Text)
      If NewVal >= SpinButton1.Min And _
          NewVal <= SpinButton1.Max Then _
          SpinButton1.Value = NewVal
  End Sub

 








Related examples in the same category

1.Set the SpinButton Min/Max and current value
2.Set Spinner value to a TextBox
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