Heres a function I wrote that is the opposite of IsNumeric. It checks to see if a string is only Alphabetic characters.
VB Code:
Function IsAlphabetic(sString As String) As Boolean Dim GetChars As String Dim i As Integer For i = 1 To Len(sString) GetChars = Mid(sString, i, 1) Select Case Asc(GetChars) Case Asc("A") To Asc("Z") Case Asc("a") To Asc("z") Case Else Exit Function End Select Next i IsAlphabetic = True End Function
Use it Like
If IsAlphabetic(text1) then Msgbox "Only Letters are in text1"





Reply With Quote