Created
May 26, 2014 10:25
-
-
Save MartinP7r/4943c68664e640ee38a3 to your computer and use it in GitHub Desktop.
checks if the String consists only of letters (A-Z, a-z) or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'source: http://techniclee.wordpress.com/2010/07/21/isletter-function-for-vba/ | |
Function IsLetter(strValue As String) As Boolean | |
Dim intPos As Integer | |
For intPos = 1 To Len(strValue) | |
Select Case Asc(Mid(strValue, intPos, 1)) | |
Case 65 To 90, 97 To 122 | |
IsLetter = True | |
Case Else | |
IsLetter = False | |
Exit For | |
End Select | |
Next | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment