I'm workin on this program that takes the string from the listindex (if the listindex has multiple words), and seperates all the words into its own index. For example
"Welcome to vb"
"forums enjoy."
and i'm trying to get it to change it all to 1 column.
"Welcome"
"to"
"vb"
"forums"
"enjoy"
this works. but it only works on the first word. i need it to go through the whole string
this code makes the example come out
"Welcome"
"forums"
"Welcome to vb"
"forums enjoy."
and i'm trying to get it to change it all to 1 column.
"Welcome"
"to"
"vb"
"forums"
"enjoy"
Code:
Dim x As Long, str As String
x = 0
Do While x < lstAccount.ListCount
If InStr(lstAccount.List(x), " ") Then
str = lstAccount.List(x)
str = Split(str, " ")(0)
lstAccount.AddItem str
End If
x = x + 1
Loop
this code makes the example come out
"Welcome"
"forums"