ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Spin Button (https://www.excelbanter.com/excel-programming/331540-spin-button.html)

[email protected]

Spin Button
 
I have a text box and spin button on a user form, I would like that the
user could enter a number in the text box and then if they wish to
change use the spin button.

How would I have the spin button start with the entered number rather
than with 1.

Any help woulf be appricated.

Kind Regards
Martin


keepITcool

Spin Button
 

Private Sub SpinButton1_Change()
TextBox1.Value = SpinButton1.Value
End Sub

Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

I have a text box and spin button on a user form, I would like that
the user could enter a number in the text box and then if they wish to
change use the spin button.

How would I have the spin button start with the entered number rather
than with 1.

Any help woulf be appricated.

Kind Regards
Martin


[email protected]

Spin Button
 
Thanks for your help. I kept on getting an error so I modified as sown
below:

Private Sub SpinButton1_Change()
TextBox1.Text = CStr(SpinButton1.Value)
End Sub
Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub

Regards
Martin

keepITcool wrote:
Private Sub SpinButton1_Change()
TextBox1.Value = SpinButton1.Value
End Sub

Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

I have a text box and spin button on a user form, I would like that
the user could enter a number in the text box and then if they wish to
change use the spin button.

How would I have the spin button start with the entered number rather
than with 1.

Any help woulf be appricated.

Kind Regards
Martin



[email protected]

Spin Button
 
Thanks for your help. I kept on getting an error so I modified as sown
below:

Private Sub SpinButton1_Change()
TextBox1.Text = CStr(SpinButton1.Value)
End Sub
Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub

Regards
Martin

keepITcool wrote:
Private Sub SpinButton1_Change()
TextBox1.Value = SpinButton1.Value
End Sub

Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

I have a text box and spin button on a user form, I would like that
the user could enter a number in the text box and then if they wish to
change use the spin button.

How would I have the spin button start with the entered number rather
than with 1.

Any help woulf be appricated.

Kind Regards
Martin



keepITcool

Spin Button
 
original works for me..
BUT
you may have check the MAX/MIN values of your spinbutton.





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

Thanks for your help. I kept on getting an error so I modified as sown
below:

Private Sub SpinButton1_Change()
TextBox1.Text = CStr(SpinButton1.Value)
End Sub
Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub

Regards
Martin

keepITcool wrote:
Private Sub SpinButton1_Change()
TextBox1.Value = SpinButton1.Value
End Sub

Private Sub SpinButton1_Enter()
SpinButton1.Value = Val(TextBox1.Text)
End Sub


--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

I have a text box and spin button on a user form, I would like
that the user could enter a number in the text box and then if
they wish to change use the spin button.

How would I have the spin button start with the entered number
rather than with 1.

Any help woulf be appricated.

Kind Regards
Martin



All times are GMT +1. The time now is 08:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com