A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
- Copy the code below into a regular module
- Add 2 column after column H
- Select the cells I2:J2
- Enter the formula =ExtractNumbers(H2) into the formula bar
- Press CTRL-SHIFT-ENTER
- Drag the formula down
Andreas.
Function ExtractNumbers(ByVal S As String) As Variant
'Returns an array with all numbers in S
Dim i As Long
'Overwrite non-numbers with blanks
For i = 1 To Len(S)
If Not IsNumeric(Mid$(S, i, 1)) Then Mid$(S, i, 1) = " "
Next
'Remove double blanks
Do While InStr(S, " ") > 0
S = Replace(S, " ", " ")
Loop
'Split the string by blanks into an array
ExtractNumbers = Split(Trim(S))
End Function