I have a userform with a listbox (shown below) that is populated from a spreadsheet (cc_output) generated by an advanced filter.
I am trying to write some code so that when you double click on a record in the listbox a lookup is performed on the spreadsheet (cc_output) to find the matching record and populate all of the data in some comboboxes in the userform.
I am trying to look up using the cc_id which is in the first column of the listbox and which is stored in column A of the spreadsheet cc_output.
This is working perfectly for records with cc_id 17 to 8 in the listbox but when I click on any records with cc_id 7 - 1 they return the wrong record from the spreadsheet.
That is
Double clicking cc_id 17 returns cc_id 17
Double clicking cc_id 16 returns cc_id 16
but...
Double clicking cc_id 7 returns cc_id 17
Double clicking cc_id 6 returns cc_id 16
and so on... until...
Double clicking cc_id 1 returns cc_id 17 also!
ListBox.PNG
Here is an excerpt of my code:
Any ideas?![]()
Please Login or Register to view this content.
Bookmarks