- Home
·
- Miscellaneous
·
- This is the alpha equivalent to IsNumeric. Returns a true if accepted characters are found while lo
This is the alpha equivalent to IsNumeric. Returns a true if accepted characters are found while lo
This is the alpha equivalent to IsNumeric. Returns a true if accepted characters are found while looping through the string. Good for
Rate This is the alpha equivalent to IsNumeric. Returns a true if accepted characters are found while lo
(1(1 Vote))
'IsAlpha - locate illegal charactes in the subject field
Public Function IsAlpha(strText As String) As Boolean
Dim intLen As Integer
Dim intCounter As Integer
Dim blnAlpha As Boolean
Dim strChar As String
intLen = Len(strText)
'Set the condition of our loop
For intCounter = 1 To intLen
strChar = Mid(strText, intCounter, 1)
'Accept A through z"
If strChar >= "A" And strChar <= "z" Then
blnAlpha = True
Else
'Accept "spaces", "periods", and "commas"
If strChar = " " Or strChar = "." Or strChar = "," Then
blnAlpha = True
'Reject everything else.
Else
blnAlpha = False
End If
End If
'We caught an illegal character (not A-z, " ", ".", or ","
If blnAlpha = False Then
IsAlpha = False
Exit Function
End If
Next intCounter
IsAlpha = True
End Function
This is the alpha equivalent to IsNumeric. Returns a true if accepted characters are found while lo Comments
No comments yet — be the first to post one!
Post a Comment