|
楼主 |
发表于 2020-3-14 21:13
|
显示全部楼层
本帖最后由 YZC51 于 2020-3-14 22:36 编辑
请老师斧正!
Public Function UNIQUE(rng, Optional x As Integer)
Set d = CreateObject("Scripting.Dictionary")
Arr = rng
For i = 1 To UBound(Arr)
If Len(Arr(i, 1)) Then d(Arr(i, 1)) = ""
Next
brr = d.keys
If x Then UNIQUE = UBound(brr) + 1: Exit Function
On Error Resume Next
UNIQUE = brr(0)
With Application.ThisCell
For j = 1 To UBound(brr, 1)
If .Offset(j) = "" Then s = Null Else s = "*"
.Offset(j).Replace s, brr(j)
Next j
End With
End Function |
评分
-
3
查看全部评分
-
|