马上注册,结交更多财务经理人,享用更多功能,成就财务总监之路……
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
取不重复值自定义函数,支持内存数组、常量数组、常量、单元格引用的混合使用,结果为一水平数组。 Code Function Only(ParamArray args() As Variant) As Variant '区分大小写英文字母、文本型和数字型数字 Dim i%, c As Range Dim tmp As Variant Dim d As Object Set d = CreateObject("scripting.dictionary")
For i = 0 To UBound(args)
If Not IsMissing(args(i)) Then
Select Case TypeName(args(i)) Case "Range" For Each c In args(i) If Not IsEmpty(c) Then d(c.Value) = "" End If Next Case "Variant()" For Each tmp In args(i) d(tmp) = "" Next Case Else d(args(i)) = "" End Select
End If
Next Only = d.keys
End Function
示例: =only(3,{"A","A","B"},"application","B") ={3,"A","B","application"} |