【VBA】多条件去重

Function kaidan(txt)
Dim i As Integer
Dim arr
Set d = CreateObject("scripting.dictionary")
For i = 1 To Worksheets("汇-销").Range("a65536").End(xlUp).Row
arr = Worksheets("汇-销").Range("a1:s" & i).Value
If arr(i, 19) = txt And arr(i, 9) > 0 Then
d(arr(i, 8)) = ""
End If
Next
kaidan = d.Count
End Function

posted @ 2017-09-07 22:38  苏苏叶  阅读(1002)  评论(0编辑  收藏  举报