回答一个网友提出的问题:
http://accessoft.com/bbs/showtopic.asp?ID=21740
Private Sub 统计_Click()
Dim i, j, l As Integer
Dim Str, S, X, Y As String
Str = "符合法规和符合法规和个符合法规和法规和和" '需要分析的字符串
l = Len(Str) '字符串长度
For j = 1 To l
If l > 0 Then
S = Left(Str, 1) '第一个字符
i = Len(Str) - Len(Replace(Str, S, "")) '判断字符数量
Str = Replace(Str, S, "") '剩下的字符串
l = Len(Str) '新字符串长度
X = X & S & "(" & i & ")" '输出表达式(字符数量)
Y = Y + S '输出表达式(字符统计)
End If
Next
MsgBox X & "||" & Y
End Sub