|
Sub test()
Dim sheetNames, ar, i&, br(1 To 9999, 1 To 24), n&, k&
Dim abc As String
abc = ChrW(27719) & ChrW(24635) & ChrW(34920)
sheetNames = Array("B", "C")
For k = LBound(sheetNames) To UBound(sheetNames)
Set sh = ThisWorkbook.Sheets(sheetNames(k))
r = sh.Range("B" & Rows.Count).End(xlUp).Row
ar = sh.Range("a1:x" & r)
For i = 20 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
Next
With Sheets(abc)
.[a4].Resize(n, 24) = br
MaxRow = .Range("A3").End(xlDown).Row
.Range("a4:x" & MaxRow).Borders.LineStyle = 1
End With
End Sub |
|