Reputation: 5
I have three list boxes in one Userform. I want a code that can perform this: Assuming I have previously selected an item in listbox1 and now I'm selecting another item in listbox2, the macro should automatically deselect the previously selected item in listbox1 and also in listbox3. I'm new to excel macros
I've tried the following but it isn't working
Dim indexi as long
indexi=Me.listbox1.listindex+1
If Listbox1.selected(indexi) Then
Listbox2.selected(indexi)=false
Listbox3.selected(indexi)=false
End if
Upvotes: 0
Views: 324
Reputation: 850
Formalizing as answer, you can deselect the selected index using
Me.Listbox1.ListIndex = -1
and use in Listbox2_Change()
function
Upvotes: 1