|
|
Title | Copy multi-line text into a ListBox using Split |
Keywords | ListBox, copy, additem, text, TextBox |
Categories | Controls |
|
|
Use Split to break the text into lines. Loop through the lines adding them to the ListBox.
|
|
Private Sub Command1_Click()
Dim values As Variant
Dim i As Integer
List1.Clear
values = Split(Text1.Text, vbCrLf)
For i = LBound(values) To UBound(values)
List1.AddItem values(i)
Next i
End Sub
|
|
|
|
|
|