Thread: Listbox control
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Listbox control

Hi Robert

If I understand you correct, you want like "third from the top in both".
These will synk them:

Private Sub ListBox1_Click()
If ListBox2.ListIndex < ListBox1.ListIndex Then _
ListBox2.ListIndex = ListBox1.ListIndex
End Sub

Private Sub ListBox2_Click()
If ListBox1.ListIndex < ListBox2.ListIndex Then _
ListBox1.ListIndex = ListBox2.ListIndex
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Robert Couchman" skrev i melding
...
Hello all,

please can i ask for some help,
i have tried many ways of getting two listboxes to line up
with each other, i would like to know of any code that
would allow one listbox to select the apropriate value
from an adjacent list box.
eg. one list box contacins there application numbers (only
the ones found) and the second list box displays there
names, i would like to select a name and it will select
the number next to the name aswell (these list boxes are
already lined up and will have the same number of values
in)

thank you,

Robert Couchman