Sunday 18 August 2013

Code to determine that the first character is upper- or lowercase and whether it’s alphabetic or numeric

Function CheckText (sText)
Dim nChar
If Len(sText) > 0 Then
nChar = Asc(sText) – Asc
If nChar >= 65 And nChar = 97 And nChar <= 122 Then
CheckText = "The first character is lowercase"
Else
CheckText = "The first character isn't alphabetical"
End If
Else
CheckText = "Please enter something in the text box"
End If
End Function

No comments:

Post a Comment