Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Select Next Item in Combo Box
Hi, I know this is pretty simple but I'm struggling with it. I want to b able to click on a command button and the combo box automatically jump 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. Jod -- ssjod ----------------------------------------------------------------------- ssjody's Profile: http://www.excelforum.com/member.php...fo&userid=3339 View this thread: http://www.excelforum.com/showthread.php?threadid=56481 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Select Next Item in Combo Box
Worked Perfectly Tom! Thanks! Jody -- ssjody ------------------------------------------------------------------------ ssjody's Profile: http://www.excelforum.com/member.php...o&userid=33398 View this thread: http://www.excelforum.com/showthread...hreadid=564819 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I need a specific value in auto filter to fill a combo box and than match the select value in 2 other columns. | Excel Worksheet Functions | |||
combo box not showing selected item.. | Excel Programming | |||
Assign macro to each item of a drop-down list or combo box - how? | Excel Programming | |||
How to clear all item from a combo box? | Excel Programming | |||
Combo Box Item | Excel Programming |