Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 2 listboxes (LB1 and LB2) side by side on a form. There are over 300
items in each list box. Each list box has been loaded. Now I would like to use a spin button to move up and down through each list box. Any help on getting started with the code to move up and down through the list boxes would be GREATLY appreciated. Thanks for all of the help........ FYI...there are 6 columns of various length in each list box. Does this make a difference? I'm considering combining my data for each row into a single column. Do I need to do that to use a spin button? -- JT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub SpinButton1_SpinDown()
With ListBox1 If .ListIndex < .ListCount - 1 Then .ListIndex = .ListIndex + 1 End If End With End Sub Private Sub SpinButton1_SpinUp() With ListBox1 If .ListIndex 0 Then .ListIndex = .ListIndex - 1 End If End With End Sub worked for me. Adjust it to handle two listboxes. -- Regards, Tom Ogilvy "JT" wrote: I have 2 listboxes (LB1 and LB2) side by side on a form. There are over 300 items in each list box. Each list box has been loaded. Now I would like to use a spin button to move up and down through each list box. Any help on getting started with the code to move up and down through the list boxes would be GREATLY appreciated. Thanks for all of the help........ FYI...there are 6 columns of various length in each list box. Does this make a difference? I'm considering combining my data for each row into a single column. Do I need to do that to use a spin button? -- JT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank You very much.......It is working exactly like I want it to.
One more question.......is it possible to highlight the first row in each listbox when the form opens and then move the highlighted row either up or down with the spin button? Thanks again for all of the help.. -- JT "Tom Ogilvy" wrote: Private Sub SpinButton1_SpinDown() With ListBox1 If .ListIndex < .ListCount - 1 Then .ListIndex = .ListIndex + 1 End If End With End Sub Private Sub SpinButton1_SpinUp() With ListBox1 If .ListIndex 0 Then .ListIndex = .ListIndex - 1 End If End With End Sub worked for me. Adjust it to handle two listboxes. -- Regards, Tom Ogilvy "JT" wrote: I have 2 listboxes (LB1 and LB2) side by side on a form. There are over 300 items in each list box. Each list box has been loaded. Now I would like to use a spin button to move up and down through each list box. Any help on getting started with the code to move up and down through the list boxes would be GREATLY appreciated. Thanks for all of the help........ FYI...there are 6 columns of various length in each list box. Does this make a difference? I'm considering combining my data for each row into a single column. Do I need to do that to use a spin button? -- JT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Spin box increase value only | Excel Discussion (Misc queries) | |||
Spin Button | Excel Programming | |||
New spin on old problems | Excel Programming | |||
Spin Control | Excel Programming | |||
Spin Button | Excel Programming |