|
Option Explicit
Sub TEST2()
Dim ar, br, i&, j&, r&, wks As Worksheet
Application.ScreenUpdating = False
ReDim ar(1 To 10 ^ 4, 1 To 6)
With Worksheets("Sheet0")
For Each wks In Worksheets
If wks.Name <> .Name Then
br = wks.UsedRange
For i = 1 To UBound(br)
If br(i, 2) = .[B1].Value And br(i, 3) = .[c1].Value Then
r = r + 1
For j = 1 To UBound(br, 2)
ar(r, j) = br(i, j)
Next j
ar(r, 6) = wks.Name
End If
Next i
End If
Next
.[A3].CurrentRegion.Clear
If r Then .[A3].Resize(r, 6) = ar
.Activate
End With
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
1
查看全部评分
-
|