I have a table that has two Columns. Date and Test Name. What I would like to happen is that the string of text in one single cell be separated into multiple rows. In additi
A formula solution is close to your requirement.
Cell H1
is the delimiter. In this case a space.
Helper E1:=SUM(E1,LEN(B1)-LEN(SUBSTITUTE(B1,$H$1,"")))+1
You must fill the above formula one row more.
A8:=a1
Fill this formula to the right.
A9:=LOOKUP(ROW(1:1),$E:$E,A:A)
Fill this formula to the right and then down.
B9:=MID($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),E:E)))+1,FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),E:E)+1))-FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),E:E)))-1)
Fill down.
Bug:
Date/time will be converted to value and blank will be filled with 0. You can add &"" to the end of the formula of A9
and B9
to block the value 0, but numbers/date/time will be converted to text.
Loop through Column A then loop through the string next to it.
Sub ChickatAH()
Dim rng As Range, Lstrw As Long, c As Range
Dim SpltRng As Range
Dim i As Integer
Dim Orig As Variant
Dim txt As String
Lstrw = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Range("A2:A" & Lstrw)
For Each c In rng.Cells
Set SpltRng = c.Offset(, 1)
txt = SpltRng.Value
Orig = Split(txt, " ")
For i = 0 To UBound(Orig)
Cells(Rows.Count, "D").End(xlUp).Offset(1) = c
Cells(Rows.Count, "D").End(xlUp).Offset(, 1) = Orig(i)
Next i
Next c
End Sub
This will require a bit of copy and paste and also the use of WORD but here are a few steps that should help you out.