说下excel如何统计表格中不同字符个数,排除重复个数?椰在线等了,鲍
发布网友
发布时间:2024-09-29 11:25
我来回答
共1个回答
热心网友
时间:2024-10-15 18:21
亲,这个用自定义函数比较容易解决。
函数位置和代码如下。
用法:=countunrept(区域)
该函数不区分大小写,空白单元格也统计在内。
Function CountUnRept(rng As Range) As Long
Dim d, k
Set d = CreateObject("Scripting.Dictionary")
Dim rg As Range
Dim i As Integer
For Each rg In rng
For i = 1 To Len(rg)
d(Mid(LCase(rg), i, 1)) = ""
Next
Next
CountUnRept = d.Count
Set d = Nothing
End Function