View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default spin up / spin down

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