Spin Button

K

koenigma

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
 
K

keepITcool

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

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

koenigma

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
 
K

koenigma

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
 
K

keepITcool

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top