I found a solution here. But I can't get it to stop after the first space.
E.g.
Col A Col B Col C Col D Col E
Bob Scott Bob Scott
Bob Joe Scott Bob Joe Scott
Bob Joe Scott Jr. Bob Joe Scott Jr.
Indefinitely...
Ultimately, It would be great to handle it like this
Col A
Bob Scott
Bob Joe Scott
Bob Joe Scott Jr.
TO
Col A Col B
Bob Scott
Bob Joe Scott
Bob Joe Scott Jr.
It would also be great to be able to select the column to parse the first word to THAT column and the rest to the next column, inserted as new.
Embarrassingly, This is how I got it to work!
E.g.
Col A Col B Col C Col D Col E
Bob Scott Bob Scott
Bob Joe Scott Bob Joe Scott
Bob Joe Scott Jr. Bob Joe Scott Jr.
Indefinitely...
Ultimately, It would be great to handle it like this
Col A
Bob Scott
Bob Joe Scott
Bob Joe Scott Jr.
TO
Col A Col B
Bob Scott
Bob Joe Scott
Bob Joe Scott Jr.
It would also be great to be able to select the column to parse the first word to THAT column and the rest to the next column, inserted as new.
Rich (BB code):
Sub parser<code>()
</code> Dim N As Long, wf As WorksheetFunction
Set wf = Application.WorksheetFunction
N = Cells(Rows.count, "A").End(xlUp).Row
Dim i As Long, j As Long, k As Long
For i = 1 To N
ary = Split(wf.Trim(Cells(i, "A").Text), " ")
k = 2
For j = LBound(ary) To UBound(ary)
Cells(i, k).Value = ary(j)
k = k + 1
Next j
Next i
End Sub
Embarrassingly, This is how I got it to work!
Rich (BB code):
Sub ParseFirstWordColumnAToColARestToColB()
Columns("B:D").Insert Shift:=xlToRight
Dim N As Long, wf As WorksheetFunction
Set wf = Application.WorksheetFunction
N = Cells(Rows.count, "A").End(xlUp).Row
Dim i As Long, j As Long, k As Long
For i = 1 To N
ary = Split(wf.Trim(Cells(i, "A").Text), " ")
k = 2
For j = LBound(ary) To UBound(ary)
Cells(i, k).Value = ary(j)
k = k + 1
Next j
Next i
Columns("A").Delete
Call CombineColumnBandC2BDeleteC
End Sub
Last edited: