Dim dststr As String = InputBox("请输入要统计的单词")
Dim b(26) As Integer
Dim a As Integer
Dim str As String = ""
For i = 1 To 26
b(i) = 0
Next
For i = 1 To Len(dststr)
a = Asc(Mid(dststr, i, 1))
If a >= 97 And a <= 122 Then
b(a - 96) += 1
End If
If a >= 65 And a <= 90 Then
b(a - 64) += 1
End If
Next
For i = 1 To 26
If b(i) <> 0 Then
str = str "字母" Chr(i + 64) "和" Chr(i + 96) "出现的次数是" b(i) "次" vbCrLf
End If
Next
TextBox6.Text = st