My userform has a simple single-select listbox which is populated programmatically when the form loads.
When I click on an item, the listbox_click event will send a message asking me if I want to do something. If I say no, then nothing will happen, and I will be returned to the listbox.
The problem is that I want to deselect the hightighted row when I return to the listbox, else if I click on a new row, two items will be highlighted. Though the newly selected item works fine, it is rather alarming for a user to see two highlighted rows.
I try to use
listbox.listIndex = -1, or
listbox.selected(listindex)=false
to make the highlight disappear without success. Instead on debugging, I found the listbox_click event was accessed a second time after the above line was executed and the listbox_click event was first exited. It didn’t access the click event a third time though (hence it isn’t recursive). I found similar posts in other sites but apparently there was no solution.
Have I missed something or is it peculiar to Excel’s single-select listbox? Please help.