Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function SaveNumer(ByVal pStr As String) As Long
'*******************************************
'Purpose: Removes alpha characters from
' a string
'Coded by: raskew
'Calls: Function IsNumeric()
'Inputs: ? SaveNumer("A1#2#3#4#5K")
'Output: 12345
'Note: As written, empty spaces are ignored.
'*******************************************
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 Mid(strHold, n, 1) = ""
SaveNumer = val(strHold)
End Function