Hi All,
I have a userform which contains a subform with a couple of listboxes in it. The objective is that the user select certain items from listbox 1, to pass to listbox 2, and when completed to click a submit button, and all of those items go to the main form. I can't put the listboxes opn the main form, because the form is already too busy (not enough real estate, as it were).
I scrounged the code to select each item individually in the second listbox using this code:
After the item is selected I want it transferred to Userform1.txtRep1. I can't seem to get that working. Additionally, what I'd like is that if there is more than one item selected, to have the items separated with either a dash or a comma (no real preference really).
any help is appreciated.
I have a userform which contains a subform with a couple of listboxes in it. The objective is that the user select certain items from listbox 1, to pass to listbox 2, and when completed to click a submit button, and all of those items go to the main form. I can't put the listboxes opn the main form, because the form is already too busy (not enough real estate, as it were).
I scrounged the code to select each item individually in the second listbox using this code:
Code:
Private Sub cmdSubmitRep_Click()
For i = 0 To listbox2.ListCount - 1
listbox2.Selected(i) = True
Next i
End Sub
After the item is selected I want it transferred to Userform1.txtRep1. I can't seem to get that working. Additionally, what I'd like is that if there is more than one item selected, to have the items separated with either a dash or a comma (no real preference really).
any help is appreciated.