Thanks for the additional information. Can you post what values you'd like to see, based on that sample?Here are some examples. Some have just numbers most of them have text as well.
07979 857798
07980634988, 07984439104
07985 349 427
07985 349427
07989 422222
0844 567 0578
0844 567 0578 Ref Lap1374099044
44 (0) 7737 987860
A on 07908855297
A on 07957797966
Aaron on 07899905803
Aaron on 07985618246
Abbey on 07970501079
abdalla on 07771588190
Abdul on 07779100309
Abeed on 07957105751
So, are you saying you want the new cell contents to be this?:I just want the numbers left.
Remove all text.
Thanks in advance
Public Function PullOnly(strSrc As String, CharType As String)
Dim RE As RegExp
Dim regexpPattern As String
Set RE = New RegExp
CharType = LCase(CharType)
Select Case CharType
Case Is = "digits":
regexpPattern = "\D"
Case Is = "letters":
regexpPattern = "\d"
Case Else:
regexpPattern = ""
End Select
RE.Pattern = regexpPattern
RE.Global = True
PullOnly = RE.Replace(strSrc, "")
End Function
Sub LeaveNumbers()
Dim cCell As Range
For Each cCell In Selection
If cCell <> "" Then
cCell.Value = "'" & PullOnly(cCell.Text, "digits")
End If
Next cCell
End Sub