+ Reply to Thread
Results 1 to 3 of 3

Auto Select Next Item in Combo Box

  1. #1
    Registered User
    Join Date
    04-12-2006
    Posts
    39

    Auto Select Next Item in Combo Box

    Hi,

    I know this is pretty simple but I'm struggling with it. I want to be able to click on a command button and the combo box automatically jumps to the next item in the list. How can I do this?

    Here is some "Hillbilly" code for what I am trying to accomplish:

    Private Sub CommandButtonAdd_Click()
    Set wa = Me.ComboBoxJumpToPart.Value
    Set wb = Range("PartsList")
    'find the (wa) .value in (wb)
    'and set (wa) to the next item in the (wb) list.
    End Sub

    Any help is appreciated.
    Jody

  2. #2
    Tom Ogilvy
    Guest

    RE: Auto Select Next Item in Combo Box

    Private Sub CommandButton1_Click()
    Dim idx as Long
    idx = Combobox1.ListIndex
    if idx <> combobox1.Listcount - 1 then
    Combobox1.ListIndex = idx + 1
    else
    Combobox1.ListIndex = 0
    end if
    end Sub

    --
    Regards,
    Tom Ogilvy


    "ssjody" wrote:

    >
    > Hi,
    >
    > I know this is pretty simple but I'm struggling with it. I want to be
    > able to click on a command button and the combo box automatically jumps
    > to the next item in the list. How can I do this?
    >
    > Here is some "Hillbilly" code for what I am trying to accomplish:
    >
    > Private Sub CommandButtonAdd_Click()
    > Set wa = Me.ComboBoxJumpToPart.Value
    > Set wb = Range("PartsList")
    > 'find the (wa) .value in (wb)
    > 'and set (wa) to the next item in the (wb) list.
    > End Sub
    >
    > Any help is appreciated.
    > Jody
    >
    >
    > --
    > ssjody
    > ------------------------------------------------------------------------
    > ssjody's Profile: http://www.excelforum.com/member.php...o&userid=33398
    > View this thread: http://www.excelforum.com/showthread...hreadid=564819
    >
    >


  3. #3
    Registered User
    Join Date
    04-12-2006
    Posts
    39
    Worked Perfectly Tom!

    Thanks!
    Jody

+ 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