Private Sub Command1_Click()
s = InputBox("请输入一个字符串:")
n1 = 0: n2 = 0: n3 = 0
For i = 1 To Len(s)
c = Mid(s, i, 1)
If c >= "A" And c <= "Z" Then n1 = n1 + 1
If c >= "a" And c <= "z" Then n2 = n2 + 1
If c >= "0" And c <= "9" Then n3 = n3 + 1
Next i
MsgBox ("大写字母:" & n1 & vbCrLf & "小写字母:" & n2 & vbCrLf & "数字:" & n3)
End Sub