Hi,
This code will change the data to desired format. It will also ask for the range where the macro should be performed, so you don't need to bother about loops.
Sub Test()
Dim rng As Range, cell As Range, str1 As String, v, i As Long
On Error Resume Next
Set rng = Application.InputBox(prompt:="Select the range", Type:=8)
If Err.Number <> 0 Then
Err.Clear
Exit Sub
End If
On Error GoTo 0
Application.ScreenUpdating = False
For Each cell In rng
str1 = ""
v = Split(cell.Value, Space(1))
For i = LBound(v) To UBound(v)
If IsNumeric(v(i)) Then str1 = str1 & ", " & v(i)
Next i
cell.Value = Mid(str1, 3)
Next cell
Application.ScreenUpdating = True
End Sub
Regards
Bookmarks