Del said:
What code can I use to detect whether the first 3 letters of a string are
upper or lower case?
Something like:
If StrComp(UCase(Left(YourString, 3)), _
Left(YourString, 3), vbBinaryCompare) = 0 _
Then
' The first three characters are upper case (or not alphabetic).
ElseIf StrComp(LCase(Left(YourString, 3)), _
Left(YourString, 3), vbBinaryCompare) = 0 _
Then
' The first three characters are lower case (or not alphabetic).
Else
' The first three characters are mixed case (or not alphabetic).
End If
Now, I assumed that by "first 3 letters", you meant the first three
characters. If it's necessary to pull the first three alphabetic characters
out of the string, no matter where in the string they are, that has to be
done first, before checking their case.