On 2/17/2010 6:23 PM, msnyc07 wrote:
> I know I can check if an individual character is uppercase If X Like "[A-Z]"
> but is there a way to check if a string of indeterminate length is all
> uppercase?
Just to throw this out in case one uses 'Option Compare'
Option Explicit
Option Compare Text
Sub Demo()
Dim s
s = "abC"
'True, but not correct
Debug.Print UCase(s) = s
'False..Correct
Debug.Print SameQ(s, UCase(s))
End Sub
Function SameQ(s1, s2)
SameQ = StrComp(s1, s2, vbBinaryCompare) = 0
End Function
= = = = = = =
HTH :>)
Dana DeLouis
|