+ Reply to Thread
Results 1 to 3 of 3

Link a Spinner to a combo box control

Hybrid View

  1. #1
    Tim
    Guest

    Link a Spinner to a combo box control

    Hi all,

    I don't know if my terminology is correct ( i am going by what pops up
    when I hold my mouse over the controls on the control tool bar) but I
    am having trouble linking a spinner to a combo box on a worksheet. What
    i want is a way for a user to cycle through the values in the combo box
    using the spinner. I am sure there should be an easy way to do this but
    for now I am stumped. I have tried linking them both to the same cell
    which works ok if I change the cell value manually but if I change it
    using the spinner the combo box does not update. Strangely if I change
    the choice in the combo box this updates the value of the spinner but
    not the other way around. Am I missing something fundamental?

    Any help appreciated

    Cheers

    Tim


  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    http://support.microsoft.com/default...b;EN-US;291073

    I just tried out their example and it works fine for me

  3. #3
    Dave Peterson
    Guest

    Re: Link a Spinner to a combo box control

    The linkedcell for the combobox from the control toolbox toolbar will contain
    the value of the combobox.

    The linkedcell for the spinner from the control toolbox toolbar will contain a
    number.

    Unless your combobox contains the same numbers that the spinner uses (and in the
    same order), you'll need more than a linkedcell to do what you want.

    But if you use the dropdown and spinner from the Forms toolbar, the linkedcell
    process will work nicely. (The linkedcell for a dropdown from the forms toolbar
    returns a number--the index into that dropdown's list.

    And make sure that the spinner's min is 1 and max is the number of items in the
    list.

    =====
    If you're set on using the controls from the Control toolbox toolbar, you could
    drop the linked cell and use code that does the work.

    This goes under the worksheet that holds the combobox and spinner:

    Option Explicit
    Private Sub ComboBox1_Change()
    Me.SpinButton1.Value = Me.ComboBox1.ListIndex
    End Sub
    Private Sub SpinButton1_Change()
    Me.ComboBox1.ListIndex = Me.SpinButton1.Value
    End Sub


    But this time, make the spinner go from 0 to number of options minus 1.
    (10 items in the combobox, then go from 0 to 9)



    Tim wrote:
    >
    > Hi all,
    >
    > I don't know if my terminology is correct ( i am going by what pops up
    > when I hold my mouse over the controls on the control tool bar) but I
    > am having trouble linking a spinner to a combo box on a worksheet. What
    > i want is a way for a user to cycle through the values in the combo box
    > using the spinner. I am sure there should be an easy way to do this but
    > for now I am stumped. I have tried linking them both to the same cell
    > which works ok if I change the cell value manually but if I change it
    > using the spinner the combo box does not update. Strangely if I change
    > the choice in the combo box this updates the value of the spinner but
    > not the other way around. Am I missing something fundamental?
    >
    > Any help appreciated
    >
    > Cheers
    >
    > Tim


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1