|
- Sub gj23w98()
- Dim brr(1 To 10000, 1 To 2)
- Set wb = Workbooks.Open(ThisWorkbook.Path & "\2.xlsx")
- For Each sht In wb.Sheets
- arr = sht.[a1].CurrentRegion
- For j = 3 To UBound(arr, 2)
- If arr(2, j) = "ABC" Then
- For i = 3 To UBound(arr)
- If Len(arr(i, j)) Then
- m = m + 1
- brr(m, 1) = arr(i, 1)
- brr(m, 2) = arr(i, 2)
- End If
- Next
- End If
- Next
- Next
- wb.Close False
- If m Then
- r = Cells(Rows.Count, 1).End(3).Row + 1
- If r = 2 Then r = 3
- Cells(r, 1).Resize(m, 2) = brr
- Else
- MsgBox "没有合乎条件的数据!"
- End If
- Set wb = Nothing
- End Sub
复制代码 |
|