|
Sub jimin()
Dim arr, d1 As Object, d2 As Object, brr
Dim crr(1 To 10000, 1 To 1)
Set d1 = CreateObject("scripting.dictionary")
Set d2 = CreateObject("scripting.dictionary")
arr = Sheet1.Range("d2:e" & Sheet1.Range("d65535").End(xlUp).Row)
For i = 1 To UBound(arr)
d1(arr(i, 1)) = 1
d2(arr(i, 2)) = 1
Next
brr = Sheet1.Range("b2:b" & Sheet1.Range("b65535").End(xlUp).Row)
For i = 1 To UBound(brr)
s = d1(Left(brr(i, 1), 3)) + d2(Right(brr(i, 1), 3))
If s = Sheet1.Range("h1") Then
crr(i, 1) = brr(i, 1)
End If
Next
Sheet1.Range("c2:c10000").ClearContents
Sheet1.Range("c2").Resize(UBound(crr), 1) = crr
End Sub |
|