How do i check if the first character in a textbox is capitalized or not?
Capitalization
Collapse
X
-
It's more fun to have more than one way to do things. :)Originally posted by scriptodim num as int
on error resume next ' just in case the first character is a number
num = ASC(left(text1. text, 1))
if num >= 65 and num <= 90 then
' it is capitalized
' do something
else
'
end if
So, another alternative would be...I just like the Select statement because the "TO" clause allows you to avoid complicating things with ANDs and ORs. It's just a matter of personal preference.Code:Select Case Left$(Text1.Text,1) Case "A" to "Z" ' It is capitalised (Australian spelling) Case Else ' It isn't. End SelectComment
Comment