Greetings, below is a snippet of code from a userform that we have been using for a while. The form has a multitude of textboxes that the user enter data into, and then these textbox values get passed to a worksheet; pretty standard stuff and it works fine. They just asked me if I could change one of the textboxes to allow multiple entries, and they want to be able to add new items to the list. Not a problem I thought, I will just change the textbox to a listbox, reference a column on a separate worksheet so that it is easy for the users to add item to the listbox (using the rowsource property) and then when the user selects the items on the listbox those values gets passed back to the worksheet.
Everything works fine except the part about passing the selected values back to the worksheet; apparently it is not as easy as just swapping out the textbox for listbox. I have googled the heck out of this and have not been able to find what I am doing wrong, guessing that simply "highlighting" the items on the listbox is not in effect selecting any values. Is there a listbox parameter that I have not set correctly, or is there additional code that needs to be added to the listbox? Thank you for any advice - Rick
Everything works fine except the part about passing the selected values back to the worksheet; apparently it is not as easy as just swapping out the textbox for listbox. I have googled the heck out of this and have not been able to find what I am doing wrong, guessing that simply "highlighting" the items on the listbox is not in effect selecting any values. Is there a listbox parameter that I have not set correctly, or is there additional code that needs to be added to the listbox? Thank you for any advice - Rick
Code:
' Transfer the Public Value
Cells(NextRow, 9) = TextBox9.Text
' Transfer the Operations Value
Cells(NextRow, 10) = TextBox10.Text
' Transfer the Technology Value
Cells(NextRow, 11) = TextBox11.Text
' Transfer the Controls Value
Cells(NextRow, 12) = ListBox1.Value
' Transfer the Recommendations
Cells(NextRow, 13) = TextBox13.Text
' Close UserForm5
Unload UserForm5