I've got a userform in Word with a listbox and a textbox which I want to fill with the selected items from the listbox. With the code below I only get the last selected item from the listbox to apear in the textbox.
Any ideas to help me out are appreciated
Any ideas to help me out are appreciated
Code:
Dim i As Integer
Private Sub UserForm_Initialize()
For i = 0 To 9
ListBox1.AddItem "Choice " & (ListBox1.ListCount + 1)
Next i
End Sub
Private Sub CommandButton1_Click()
For i = 0 To 9
If ListBox1.Selected(i) = True Then
TextBox1.Text = ListBox1.List(i)
End If
Next i
End Sub