Public Function ExtractedValue(strSent) As Double
If IsNull(strSent) Then
Exit Function
End If
Dim strTemp As String
Dim intLoop As Integer
'This function extracts a numeric values from a string and returns it
' in ExtractedValue
'Return value of 0 if no numbers found
ExtractedValue = 0
strTemp = ""
'Perform the extraction
For intLoop = 1 To Len(strSent)
If Asc(Mid(strSent, intLoop, 1)) >= 48 And Asc(Mid(strSent, intLoop, 1)) <= 59 Then
strTemp = strTemp & Mid(strSent, intLoop, 1)
End If
Next intLoop
If Len(strTemp) > 0 Then
ExtractedValue = Val(strTemp)
End If
End Function