Function SaveNumer2(ByVal pStr As String) As Long
'*******************************************
'Purpose: Removes alpha and non-numeric characters from
' a string
'Coded by: raskew
'Calls: Function IsNumeric()
'Inputs: ? SaveNumer2("ABC234BB")
'Output: 234
'*******************************************
Dim strHold As String
Dim intLen As Integer
Dim n As Integer
strHold = Trim(pStr)
intLen = Len(strHold)
n = 1
Do
If Mid(strHold, n, 1) <> " " And Not IsNumeric(Mid(strHold, n, 1)) Then
strHold = Left(strHold, n - 1) + Mid(strHold, n + 1)
n = n - 1
End If
n = n + 1
Loop Until val(strHold) > 0
SaveNumer2 = val(strHold)
End Function