Public Function basGetDigits(ByVal Literal as String, _ Optional ByVal InclDec = False) As String
Dim lngCount As Long
Dim strChar As String
Dim strRet As String
Dim strCmp As String
If InclDec Then
strCmp = "1234567890."
Else
strCmp = "1234567890"
End If
For lngCount = 1 To VBA.Len(str)
strChar = VBA.Mid$(str, lngCount, 1)
If VBA.InStr(strCmp, strChar) > 0 Then
strRet = strRet & strChar
End If
Next
basGetDigits = strRet
End Function