Option Explicit
Sub TEST2()
Dim ar, br, i&, j&, r&, wks As Worksheet
Application.ScreenUpdating = False
With [A1].CurrentRegion
.Offset(2).ClearContents
r = 2
ar = .Resize(10 ^ 3)
End With
For Each wks In Worksheets
If wks.Name Like "*自查表" Then
br = wks.[A1].CurrentRegion.Value
For i = 3 To UBound(br)
If Join(Application.Index(br, i), "") <> "" Then
r = r + 1
ar(r, 1) = r - 2
For j = 2 To UBound(br, 2)
ar(r, j) = br(i, j)
Next j
End If
Next i
End If
Next
[A1].Resize(r, UBound(ar, 2)) = ar
Application.ScreenUpdating = True
Beep
End Sub
|