|
Sub test()
Dim ar, sh As Worksheet, i&, br(1 To 9999, 1 To 24), n&
Dim abc As String
Dim rn As Range
abc = ChrW(27719) & ChrW(24635) & ChrW(34920)
For Each sh In Sheets
If sh.Index > Sheets("汇总表").Index Then
r = sh.Range("B" & Rows.Count).End(xlUp).Row
Set rn = sh.Range("a1:x" & r).Find("序号", , , , , , 1)
ks = rn.Row + 1
ar = sh.Range("a1:x" & r)
For i = ks To r
If ar(i, 2) <> "" Then
n = n + 1
For j = 1 To 24
br(n, j) = ar(i, j)
Next
End If
Next
End If
Next
With Sheets(abc)
.UsedRange.Offset(3).Borders.LineStyle = 0
.UsedRange.Offset(3) = Empty
.[a4].Resize(n, 24) = br
.Range("a4:x" & n + 3).Borders.LineStyle = 1
End With
MsgBox "ok!"
End Sub
|
|