|
我师傅给了我段代码可以向下排:
Sub test()
Dim i As Long
Dim rngTitle As Range
Dim vData As Variant
Dim lEndRow As Long
Sheets("combine").Cells.Delete
For i = 1 To Sheets.Count
With Sheets(i)
lEndRow = .[B4].End(xlDown).Row
vData = .Range(.Cells(4, 2), .Cells(lEndRow, 12))
With Sheets("combine")
.Cells(.[B65536].End(xlUp).Row + 1, 2).Resize(UBound(vData), 11) = vData
End With
End If
End With
Next
With Sheets("combine")
lEndRow = .[B65536].End(xlUp).Row
.Range("A3:A4") = Application.Transpose(Array(1, 2))
.Range("A3:A4").AutoFill .Range("A3:A" & lEndRow)
End With
End Sub |
|