View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Faraz A. Qureshi Faraz A. Qureshi is offline
external usenet poster
 
Posts: 211
Default Extracting Digits From Text

What could be wrong with the following piece of code for a UDF?

Function NFW(RNG As Range)
Dim RSLT As String
RSLT = ""
For X = 1 To Len(RNG)
If Asc(Mid(RNG.Text, X, 1).Value) 47 And _
Asc(Mid(RNG.Text, X, 1).Value) < 58 Then
RSLT = RSLT & Mid(RNG.Text, X, 1)
End If
Next
NFW = RSLT
End Function

--
Thanx in advance,
Best Regards,

Faraz