|
- Sub shishi()
- Dim brr(), Rng As Worksheet
- Application.DisplayAlerts = False
- Application.ScreenUpdating = False
- Set dic = CreateObject("Scripting.Dictionary")
- arr = Range("a1").CurrentRegion
- For i = 4 To UBound(arr)
- If Not dic.exists(arr(i, 2)) Then
- dic(arr(i, 2)) = ""
- End If
- Next
- For Each Rng In Worksheets
- If Rng.Name <> "说明" Then
- arr = Rng.Range("a1").CurrentRegion
- For i = 2 To UBound(arr)
- If dic.exists(arr(i, 2)) Then
- n = n + 1
- ReDim Preserve brr(1 To n)
- brr(n) = Array(n, arr(i, 2), arr(i, 3), arr(i, 4), arr(i, 5), arr(i, 6), arr(i, 7), arr(i, 8), arr(i, 9), arr(i, 10))
- End If
- Next
- Rng.Range("a2:j500").Clear
- Rng.Range("a2").Resize(n, 10) = Application.Rept(brr, 1)
- n = 0
- Erase brr
- End If
- Next
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|