A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You are going to need VB code to do that. Here is a function that you can use in your own code OR as a UDF (user defined function)...
Function GetNumbers(ByVal S As String) As String
Dim X As Long
For X = 1 To Len(S)
If Mid(S, X, 1) Like "[!0-9" & Chr$(10) & "]*" Then Mid(S, X, 1) = " "
Next
GetNumbers = Replace(Replace(Replace(WorksheetFunction.Trim(S), " " & vbLf, vbLf), vbLf & " ", vbLf), " ", ",")
Do While InStr(GetNumbers, vbLf & vbLf)
GetNumbers = Replace(GetNumbers, vbLf & vbLf, vbLf)
Loop
End Function
If you use it within your own code, you would call it like this...
Range("B1").Value = GetNumbers(Range("A1"))
If you use it as a UDF (that is, a formula located directly on your worksheet), then you would put this formula in B1...
=GetNumbers(A1)
To install the function for either type of usage, press Alt+F11 from any worksheet to go into the VB editor, then click Insert/Module from the VB editor's menu bar, and then copy/paste the above function into the code window that opened up.