View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
recrit recrit is offline
external usenet poster
 
Posts: 20
Default extract number from alphanumric

On Jul 2, 9:40*am, Hardeep_kanwar
wrote:
Hi! Everybody

i have number of alphanumric list

For ex. asde1258rfgtt125
* * * * * *iqewr1258erer1258
* * * * * *kpijs780025dfdfd789

And so on
how can i extract only numbers
For example-1258125
* * * * * * * * * *12581258
* * * * * * * * * *780025789

Thanks in Advance

Hardeep kanwar


couldn't find a simple spreadsheet formula to do this.... maybe
someone else can come up with that
Here is a vb function that once inserted in a module can be used on
the worksheet. Its a very basic implementation:


Function parseInt(text)
Dim i As Long
Dim ch As String
Dim nums As String

nums = ""
For i = 1 To Len(text)
ch = Mid(text, i, 1)
If IsNumeric(ch) Then nums = nums & ch
Next i

parseInt = nums
End Function