|
Option Explicit
Sub TEST6()
Dim ar, br, i&, j&, r&, dic As Object, strJoin$
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
ar = Worksheets(2).[A1].CurrentRegion.Value
For i = 2 To UBound(ar)
strJoin = ""
For j = 2 To 5
If Len(ar(i, j)) Then
strJoin = strJoin & "|" & ar(i, j)
End If
Next j
dic(ar(i, 1)) = strJoin & "|"
Next i
r = Cells(Rows.Count, "A").End(xlUp).Row
ar = Range("A1:B" & r).Value
ReDim br(1 To UBound(ar), 0)
br(1, 0) = "标记"
For i = 2 To UBound(ar)
If InStr(dic(ar(i, 1)), "|" & ar(i, 2) & "|") Then br(i, 0) = 1
Next i
[C1].Resize(UBound(br)) = br
Set dic = Nothing
Application.ScreenUpdating = True
Beep
End Sub
|
|