RECrerar
09-11-2007, 05:04 AM
Hi, I've had a search and can't find this.
I have a userform with two listboxes. Listbox2 is populated from a worksheet with values that depend on the value of listbox1. Listbox2 will sometimes be empty.
If listbox2 is not empty I need an error message displayed if nothing is selected.
The problem occurs if an item in listbox2 is selected and then the user selects a different value in listbox 1 which brings up a different set of values in listbox2. Even if none of the new values are selected my code refuses to believe that listbox2.value = "". Also the code sporadically desides not to work even if no value in listbox2 has ever been selected.
I'm not sure how well that is explained, so I've attached a workbook which you can look at
I have a userform with two listboxes. Listbox2 is populated from a worksheet with values that depend on the value of listbox1. Listbox2 will sometimes be empty.
If listbox2 is not empty I need an error message displayed if nothing is selected.
The problem occurs if an item in listbox2 is selected and then the user selects a different value in listbox 1 which brings up a different set of values in listbox2. Even if none of the new values are selected my code refuses to believe that listbox2.value = "". Also the code sporadically desides not to work even if no value in listbox2 has ever been selected.
I'm not sure how well that is explained, so I've attached a workbook which you can look at