Dim a As String, b As Long, c As Long, D As Long, E As Long, f As Long, g As Long, h As Long
b = 0
E = 0
f = 0
c = 0
a = Me.文本1
For i = 1 To Len(a)
D = Asc(Mid(a, i, 1))
If D < 0 Then '中文
b = b + 1
ElseIf D > 64 And D <= 90 Then '大写字母
c = c + 1
ElseIf D > 96 And D < 123 Then '小写字母
E = E + 1
ElseIf D > 47 And D < 58 Then '数字
f = f + 1
End If
Next i
h = Len(a) - b - c - E - f '其它,如空格,半角标点
MsgBox "总共有" & Len(a) & "个字符,中文" & b & "个,英文大写" & c & "个,英文小写" & E & "个,数字" & f & "个,其它" & h & "个"
End Sub