Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default spin button code


How do I get the spin button to control the text box

I want TextNumberOfGames(TextBox) to change when the
SpinNumberOfGames(SpinButton) is clicked up or down.

This is all in a form. I have already set the min, max, and change.

I would also like, if possible for the default to be 1, when the form
opens.


Thanks

Josh


--
jhahes
------------------------------------------------------------------------
jhahes's Profile: http://www.excelforum.com/member.php...o&userid=23596
View this thread: http://www.excelforum.com/showthread...hreadid=475931

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default spin button code

One way of doing it would be the following code (you'll have to insert
your limits)...

Option Explicit
Public i As Integer

Private Sub SpinNumberOfGames_SpinDown()
i = i - 1
TextNumberOfGames.Value = i

End Sub

Private Sub SpinNumberOfGames_SpinUp()
i = i + 1
TextNumberOfGames.Value = i

End Sub

Private Sub UserForm_Activate()
i = 1
TextNumberOfGames.Value = i

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default spin button code

In the change event of the spin button, update the textbox with the value of
the spin button

In the initialize event of the userform, change the value of the spinbutton
to 1.

--
Regards,
Tom Ogilvy


"jhahes" wrote in
message ...

How do I get the spin button to control the text box

I want TextNumberOfGames(TextBox) to change when the
SpinNumberOfGames(SpinButton) is clicked up or down.

This is all in a form. I have already set the min, max, and change.

I would also like, if possible for the default to be 1, when the form
opens.


Thanks

Josh


--
jhahes
------------------------------------------------------------------------
jhahes's Profile:

http://www.excelforum.com/member.php...o&userid=23596
View this thread: http://www.excelforum.com/showthread...hreadid=475931



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default spin button code

....and I never knew a SpinButton held its own value. Makes sense
really...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spin Button [email protected] Excel Programming 4 June 12th 05 07:43 PM
spin button value tina Excel Discussion (Misc queries) 2 March 17th 05 02:11 PM
spin button bruce forster Excel Programming 1 May 7th 04 12:21 AM
Spin Button... scottnshelly[_25_] Excel Programming 4 April 30th 04 07:49 AM
Spin Button Andrew[_14_] Excel Programming 1 July 18th 03 01:51 AM


All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"