Skip to content

Instantly share code, notes, and snippets.

@MartinP7r
Created May 26, 2014 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinP7r/4943c68664e640ee38a3 to your computer and use it in GitHub Desktop.
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
'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