|
Sub test()
Dim d, arr, brr, i&, j&, k&, m&, n&
Set d = CreateObject("Scripting.Dictionary")
arr = Sheet1.Range("b3:g" & Sheet1.[b3].End(4).Row)
brr = Sheet2.Range("b3:e" & Sheet2.[b3].End(4).Row)
ReDim crr(1 To UBound(arr), 1 To 2)
For i = 1 To UBound(arr)
If arr(i, 6) = "√" Then
d(arr(i, 1)) = ""
End If
Next
For i = 1 To UBound(brr)
If brr(i, 4) = "√" Then
If d.exists(brr(i, 1)) Then
m = m + 1
crr(m, 1) = brr(i, 1)
crr(m, 2) = "√"
End If
End If
Next
With Sheet3.[b3]
.Resize(1000, 2).ClearContents
.Resize(m, 2) = crr
End With
Set d = Nothing
End Sub |
|