|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub lee()
Dim d As Object, arr, brr, i%, j%, k%
Set d = CreateObject("scripting.dictionary")
arr = Range("A2:A" & Cells(Rows.Count, 1).End(3).Row)
brr = Range("B2:B" & Cells(Rows.Count, 2).End(3).Row)
For i = 1 To UBound(arr)
d(arr(i, 1)) = ""
Next
ReDim crr(1 To UBound(arr), 1 To 1)
For j = 1 To UBound(brr)
If d.exists(brr(j, 1)) Then
k = k + 1
d.Remove brr(j, 1)
End If
Next
Range("C2:C500").ClearContents
[C2].Resize(d.Count) = WorksheetFunction.Transpose(d.keys)
End Sub |
|