Hi ykobure,
I ran into the following issues (and/or noticed the following) while attempting to solve your problem:
a. Column Count is limited to columns 0 to 9 in a ListBox if the ListBox is UNBOUND. See http://www.ozgrid.com/Excel/free-tra...a1lesson24.htm When a ListBox is Bound, the Bound Column contains the value returned as .Value for that row.
b. I had to change the data comparison logic in the following construction:
c. For ease of debugging I added CONDITIONAL COMPILATION that seeded values in the UserForm in DisplayUserForm(). Follow instructions in the code to remove the seed values.
d. For data consistency, I replaced the RANDBETWEEN() with constant values that were obtained from RANDBETWEEN().
e. For some unknown reason, I had a problem (which acted like clicking the same item twice) when I selected an item from ListBox4 for the first time. I put in a workaround in ListBox4_Change() to ignore the 2nd Selection if it occurred within one second of the first Selection. The workaround improved the situation, but did not fix it completely. If a click in ListBox4 does not activate a selection, just repeat, and it should work.
f. I had to change the 'ColumnHeads' attribute in ListBox3 to 'False', because 'Column Headers' only work when the 'RowSource' attribute is used to populate the ListBox. We are NOT using the 'RowSource' attribute, because we are filtering the data that appears in the ListBox.
See the attached file which includes the following code:
UserForm module:
Ordinary Code Module Code will be included in the next post due to space limitations.
Lewis
Bookmarks