Hi all,
I have a Userform with two Listboxes and two Labels on it. Both Listboxes are populated in the Initialize procedure and one item is selected in each as a default when the user launches the Userform. I would like the Label1 to show the item selected in the Listbox1 and Label2 to show the item selected in Listbox2. This is an abbreviated version of what it will do and Labels could be substituted with Textboxes, I have the same issue no matter what.
The issue...Userform loads, Listboxes populate, one item in each is selected (using Listbox1.Selected(0) = True and Listbox2.Selected(1) = True). I try to get Labels to display the value selected in Listboxes (using Label1.Caption = Listbox1.Text and Label2.Caption = Listbox2.Text). Only one Listbox will display the selected item, the other is blank. Both Listboxes are Single Select. I am positive that the one that shows has changed with some change to the code or just by reloading the Userform but I cannot replicate when it changes or guess as to why it would switch from showing one to the other. When stepping through the code, I can see it select the items in both and when the form is shown there are selections in both, why does it not return the .Text value from both?
Hopefully I have adequately described the issue. Thanks in advance for your help.
Doug
I have a Userform with two Listboxes and two Labels on it. Both Listboxes are populated in the Initialize procedure and one item is selected in each as a default when the user launches the Userform. I would like the Label1 to show the item selected in the Listbox1 and Label2 to show the item selected in Listbox2. This is an abbreviated version of what it will do and Labels could be substituted with Textboxes, I have the same issue no matter what.
The issue...Userform loads, Listboxes populate, one item in each is selected (using Listbox1.Selected(0) = True and Listbox2.Selected(1) = True). I try to get Labels to display the value selected in Listboxes (using Label1.Caption = Listbox1.Text and Label2.Caption = Listbox2.Text). Only one Listbox will display the selected item, the other is blank. Both Listboxes are Single Select. I am positive that the one that shows has changed with some change to the code or just by reloading the Userform but I cannot replicate when it changes or guess as to why it would switch from showing one to the other. When stepping through the code, I can see it select the items in both and when the form is shown there are selections in both, why does it not return the .Text value from both?
Hopefully I have adequately described the issue. Thanks in advance for your help.
Doug