5个回答
展开全部
Sub xx()
Dim d As Object, c As Range
Set d = CreateObject("scripting.dictionary")
Set c = [b5:u20]
n = c.Count
For i = 1 To n
k = len(c.Item(i))
for j =1 to k
x=mid(c.Item(i),j,1)
d(x) = d(x) + 1
next
Next
k = d.keys
t = d.items
ReDim a(0 To UBound(k))
For i = 0 To UBound(a)
a(i) = i
Next
For i = 1 To UBound(a)
For j = UBound(a) To i Step -1
If t(a(j)) > t(a(j - 1)) Then
tmp = a(j)
a(j) = a(j - 1)
a(j - 1) = tmp
End If
Next
Next
Set c = [b2]
For i = 0 To UBound(a)
c.Offset(0, i) = k(a(i))
c.Offset(1, i) = t(a(i)) & "次"
Next
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是对象属性搞错了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不用vba也可以实现,为什么用vba。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
excel vba搞定没 我可以做
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询