|
Sub 筛选()
Dim r, ARR, i, J, k, gonext
Application.ScreenUpdating = False
Set d = CreateObject("Scripting.Dictionary")
ARR = Worksheets("sheet1").[A1].CurrentRegion
For J = 2 To UBound(ARR)
If ARR(J, 7) = 1 Then d(ARR(J, 1)) = J
Next
Sheets(2).Select
r = Range("A104587").End(xlUp).Row
For i = 2 To r
If d.exists(Cells(i, 1).Value) Then
J = d(Cells(i, 1).Value)
Cells(i, 2) = ARR(J, 2)
Cells(i, 3) = ARR(J, 3)
Cells(i, 4) = ARR(J, 4)
Cells(i, 5) = ARR(J, 5)
Cells(i, 6) = ARR(J, 6)
Cells(i, 7) = ARR(J, 7)
End If
Next
End Sub
表1里的每种编码,只可能有1条记录的G列是1吗?
|
|