Hello,
I have a listbox in a userform that interacts with a worksheet that has a list of individuals by country.
I have a macro that runs when a person selects one of the countries using the list-box that colors all of the individuals that are in the country red on the worksheet. It looks approximately like this:
What I would like to do is be able to allow users to select multiple countries using the multi-select option in the listbox and thereby color the cells for multiple countries. I am just not sure how to write the above code for multiple countries.
Any thoughts?
-Ilya
I have a listbox in a userform that interacts with a worksheet that has a list of individuals by country.
I have a macro that runs when a person selects one of the countries using the list-box that colors all of the individuals that are in the country red on the worksheet. It looks approximately like this:
Code:
For Each MyCell in Countries
If MyCell.Text = Listbox.Text Then
'code to color etc.
Next
What I would like to do is be able to allow users to select multiple countries using the multi-select option in the listbox and thereby color the cells for multiple countries. I am just not sure how to write the above code for multiple countries.
Any thoughts?
-Ilya