|
Option Explicit
Sub TEST2()
Dim ar, br, i&, j&, r&, n&, wks As Worksheet, iStart&
Application.ScreenUpdating = False
For Each wks In Worksheets
If wks.Name <> "汇总表" Then
ar = wks.[A1].CurrentRegion.Value
If IsArray(ar) Then
n = n + 1
If n = 1 Then
ReDim br(1 To 10 ^ 3, 1 To UBound(ar, 2))
iStart = 1
Else
iStart = 2
End If
For i = iStart To UBound(ar)
r = r + 1
For j = 1 To UBound(br, 2)
br(r, j) = ar(i, j)
Next j
Next i
End If
End If
Next
With Worksheets("汇总表")
.Cells.Clear
With .[A1].Resize(r, UBound(br, 2))
.Value = br
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Borders.LineStyle = xlContinuous
End With
.Activate
End With
Application.ScreenUpdating = True
Beep
End Sub |
|