Listbox linking

khur_chesk

New Member
Joined
Oct 25, 2011
Messages
21
I have two listboxes, each having items based on same criteria, meaning two column values in the respective listboxes of the same row, now if i highlight item of listbox1 it should also highlight its corresponding item in listbox 2, How am i suppose to do that?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Add code for the first listbox to set the selected value of the second listbox the same as the first.

Code:
Private Sub Listbox1_Change()

     If Listbox1.ListIndex<> -1 Then
           Listbox2.ListIndex =  Listbox2.ListIndex
     End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,207,280
Messages
6,077,506
Members
446,287
Latest member
tjverdugo85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top