Removing text from cells

C

Craig

Hi,

I have a big spread sheet with ref numbers like below.
What I want to do is remove all the lettes and just leave
numbers. Is it possible?

FB/JW/CBE/TEMP6452/
JC/PB/KSC/53399/
FB/DJR/KSC/46896/
FB/70823/
RD/57996/

Many thanks,
 
F

Frank Kabel

Hi
try the following macro
Sub remove_text()
Dim rng As Range
Dim cell As Range
Dim i As Integer
Dim sres
Dim ssource

Set rng = Selection
For Each cell In rng
If cell.Value <> "" Then
ssource = cell.Value
sres = ""
For i = 1 To Len(ssource)
If IsNumeric(Mid(ssource, i, 1)) Then
sres = sres & Mid(ssource, i, 1)
End If
Next i
cell.Value = CDbl(sres)
End If
Next cell
End Sub
 
Top