|
Sub qs()
Dim arr, i, dic As Object
Set dic = CreateObject("scripting.dictionary")
arr = Sheet2.Range("a1").CurrentRegion.Value
For i = 2 To UBound(arr)
s = arr(i, 2)
If s <> Empty Then
If Not dic.exists(s) Then
dic(s) = arr(i, 6)
Else
dic(s) = dic(s) & " " & arr(i, 6)
End If
End If
Next
With Sheet1
ss = .Range("c9").Value
.Range("c9").Interior.Pattern = xlNone
rw = .Cells(Rows.Count, "e").End(xlUp).Row
If dic.exists(s) Then
.Range("c9").Interior.Color = 5296274
t = dic(s)
End If
For i = 12 To rw
.Range("e" & i).Interior.Pattern = xlNone
If InStr(t, .Range("e" & i).Value) Then
.Range("e" & i).Interior.Color = 5296274
End If
Next
End With
End Sub
|
|