Private Sub Command1_Click() Dim str As String str = "AACc" If UCase(str) <> str Then MsgBox "有小写字母" End Sub
Dim i As Integer Dim s As Long If Len(Text1) < 1 Then Exit Sub For i = 1 To Len(Text1) s = Asc(Mid(Text1.Text, i, 1)) If s > 97 And s < 122 Then MsgBox "有小写字母存在" End If Next i
Private Sub Command1_Click()If Text1 Like "*[a-z]*" Then MsgBox "yes"End Sub
public function ExistXchar(str as string) as boolean dim i as integer ExistXchar=false for i=1 to len(str) if mid(str,i,1)>asc("a") and mid(str,i,1)<asc("z") then ExistXchar=true exit function end if next end function
Private Sub Command1_Click() Dim str As String str = "BBDd" If UCase(str) = str Then Debug.print "米有小写字母" Else Debug.print "有小写字母" End if End Sub
Dim str As String
str = "AACc"
If UCase(str) <> str Then MsgBox "有小写字母"
End Sub
Dim s As Long
If Len(Text1) < 1 Then Exit Sub
For i = 1 To Len(Text1)
s = Asc(Mid(Text1.Text, i, 1))
If s > 97 And s < 122 Then
MsgBox "有小写字母存在"
End If
Next i
dim i as integer
ExistXchar=false
for i=1 to len(str)
if mid(str,i,1)>asc("a") and mid(str,i,1)<asc("z") then
ExistXchar=true
exit function
end if
next
end function
Dim str As String
str = "BBDd"
If UCase(str) = str Then
Debug.print "米有小写字母"
Else
Debug.print "有小写字母"
End if
End Sub