K
Kevin993
Guest
Greetings,
I have 2 listboxes with the same number of items :
Each item in listbox1 (the left one) corresponds to the same item in listbox2. So corresponding value of 123 is 600.
There might be duplicate values in the first listbox. For example, in the picture above, 123 is repeated twice.
I need to keep the first occurrence of a value (the first 123 , index = 0) and delete the other duplicate values, but on this condition : Corresponding values (listbox2) of the deleted items (listbox1) must be added to the value (listbox2) of the only existing occurrence of a value (123).
So here would be the result :
I already know how to find duplicate values in a listbox, but need help on adding values to listbox2 :
For Row As Int16 = 0 To inputList.Items.Count - 2
For RowAgain As Int16 = inputList.Items.Count - 1 To Row + 1 Step -1
If inputList.Items(Row).ToString = inputList.Items(RowAgain).ToString Then
' RowAgain is duplicate
End If
Next
Next
Continue reading...
I have 2 listboxes with the same number of items :
Each item in listbox1 (the left one) corresponds to the same item in listbox2. So corresponding value of 123 is 600.
There might be duplicate values in the first listbox. For example, in the picture above, 123 is repeated twice.
I need to keep the first occurrence of a value (the first 123 , index = 0) and delete the other duplicate values, but on this condition : Corresponding values (listbox2) of the deleted items (listbox1) must be added to the value (listbox2) of the only existing occurrence of a value (123).
So here would be the result :
I already know how to find duplicate values in a listbox, but need help on adding values to listbox2 :
For Row As Int16 = 0 To inputList.Items.Count - 2
For RowAgain As Int16 = inputList.Items.Count - 1 To Row + 1 Step -1
If inputList.Items(Row).ToString = inputList.Items(RowAgain).ToString Then
' RowAgain is duplicate
End If
Next
Next
Continue reading...