去重

Sub 去重()
Application.ScreenUpdating = False
Dim r As Range, arr
With CreateObject("scripting.dictionary")
a = Cells(2000, 9).End(xlUp).Row
    For k = 9 To 10
        For Each r In Range(Cells(4, k), Cells(a, k))
            If Not .Exists(r.Value) And r.Value <> "" Then .Add r.Value, Nothing
        Next
            Cells(4, k + 4).Resize(.Count, 1) = Application.WorksheetFunction.Transpose(.Keys)
            .RemoveAll
    Next
End With
Application.ScreenUpdating = True
End Sub

 

posted on 2018-08-20 12:05  lizicheng  阅读(195)  评论(0编辑  收藏  举报

导航