Sub JOY240801()
Dim arr, brr, r%, i%, S$, x%, y%
Sheet1.Activate
r = [D1].End(4).Row - 1
arr = Range("D2:D" & r)
ReDim brr(1 To r, 1 To 7)
For i = 1 To UBound(arr)
S = arr(i, 1)
x = InStr(S, " ")
y = InStrRev(S, " ")
brr(i, 1) = Replace(Mid(S, 1, y - 1), " ", vbLf)
brr(i, 2) = Replace(S, " ", vbLf)
brr(i, 3) = Replace(S, " ", vbLf, , 1)
brr(i, 4) = Mid(S, 1, y - 1)
brr(i, 5) = Mid(S, y + 1, Len(S) - y)
brr(i, 6) = Mid(S, x + 1, y - x - 1)
brr(i, 7) = Mid(S, 1, x - 1)
Next
[U2].Resize(r, 7) = brr
End Sub |