Highlight multiple items in listbox based on textbox item
I have a user form with a ListBox2 (which represents a list for 'facility' code and description) that is populated when the form is Initialized.
I also have a text box that represents the same 'facility' that is populated when the user selects an item from a second ListBox1 (which looks at existing records on a spreadsheet and brings back records based on a series of combo box selections made by the user).
What I would like to be able to do is once the tex box has been populated by selecting ListBox1, I would like for the items (NB: there can be multiple items in the text box i.e. I have a string of text in the Facility code on the spreadsheet seperated by a carriage return in the cell) that are now in the text box to be highlighted in List Box 2!
At the moment I have code that is able to populate the text box once the user highlights multiple items in List Box 2 and exits, but I want to able to do the revers i.e. have the items become highlighted in List Box 2 (before the user has taken any action) based on the items in the text box.
Can any one help?
|