|
Public Function test(rng As Range, x As String)
Set d = CreateObject("scripting.dictionary")
For Each rn In rng
For i = 1 To Len(rn)
d(Mid(rn, i, 1)) = 1 + d(Mid(rn, i, 1))
Next i
Next rn
If Not d.exists(x & "") Then test = 0: Exit Function
arr = d.items
For j = 0 To UBound(arr)
For i = j + 1 To UBound(arr)
If arr(j) < arr(i) Then
tmp = arr(j)
arr(j) = arr(i)
arr(i) = tmp
End If
Next i
Next j
w = d(x & "")
For j = 0 To UBound(arr)
If w = arr(j) Then
test = j + 1
Exit For
End If
Next j
End Function
|
评分
-
2
查看全部评分
-
|