|
- Sub lqxs()
- Dim Arr, i&, myPath$, myName$, Arr1, n&, cz$
- myPath = ThisWorkbook.Path & ""
- myName = "2.xlsx"
- With GetObject(myPath & myName)
- Arr1 = .Sheets(2).Range("A1").CurrentRegion
- .Close False
- End With
- Sheet2.Activate
- [a2:b500].ClearContents: n = 1
- Arr = Sheet1.[a1].CurrentRegion
- For i = 2 To UBound(Arr)
- cz = Arr(i, 1)
- For j = 2 To UBound(Arr1)
- If Arr1(j, 6) = cz Then
- For x = j To 2 Step -1
- If Arr1(x, 3) = 0 Then
- n = n + 1
- Cells(n, 1) = Arr1(x, 6): Cells(n, 2) = 0: Exit For
- End If
- Next
- End If
- Next
- Next
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|