Question : VBA to split up a text string

I am looking for VBA code that will parse out the text located in cell A1 into separate rows.  Row 2 contains an example of what I am looking to accomplish.  Some info on this problem:

1.      This particular example has 18 lines, but it could be any number of lines ranging from 1 to over 10,000.
2.      The columns within each line are space delimited.  In the event a word would normally be 2 words, it is always separate by a period and not a space.  For example, if an items color was Light Blue it would show up as Light.Blue, so in that regard it is safe to assume you can use a space to split out each line.


Thats it&whats throwing my off is I cant figure out how to determine what constitutes a line.

Thanks

Answer : VBA to split up a text string

Try this to split it.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
    Range("A1").Select
    a$ = ActiveSheet.Range("A1").Value
    MsgBox a$
    While (Len(a$) > 1)
        pos = InStr(a$, Chr$(10))
        b$ = Left(a$, pos)
        a$ = Mid(a$, pos + 1)
        If Len(b$) > 1 Then MsgBox b$
        If (pos = 0) Then a$ = ""
    Wend
Open in New Window Select All
Random Solutions  
 
programming4us programming4us