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?
 
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

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