|
数据对碰.zip
(240.34 KB, 下载次数: 5)
注意表格格式
Sub test()
Application.ScreenUpdating = False
Sheet3.Range("A1:A" & Sheet3.Cells(Rows.Count, 1).End(3).Row).ClearContents
Dim sz1, sz2, sz3, aa1
sz1 = Sheet1.Range(Sheet1.Cells(1, 1), Sheet1.Cells(Sheet1.Cells(Rows.Count, 1).End(3).Row, 1))
sz2 = Sheet2.Range(Sheet2.Cells(1, 1), Sheet2.Cells(Sheet2.Cells(Rows.Count, 1).End(3).Row, 1))
Dim d, dd, d1
Set d = CreateObject("Scripting.Dictionary")
Set dd = CreateObject("Scripting.Dictionary")
For Each d1 In sz2
d(d1) = ""
Next
For aa1 = 2 To UBound(sz1)
If Not d.Exists(sz1(aa1, 1)) Then
dd(sz1(aa1, 1)) = ""
End If
Next
sz3 = dd.keys
Sheet3.[A1].Resize(dd.Count, 1) = Application.Transpose(sz3)
Application.ScreenUpdating = True
End Sub
|
|