Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim lastrowDB As Long, lastrow As Long
- Dim array1, array2, i As Integer
- With Sheets("Sheet1")
- lastrowDB = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
- End With
- array1 = Array("C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N")
- array2 = Array("C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N")
- For i = LBound(array1) To UBound(array1)
- With Sheets("Sheet1")
- lastrow = Application.Max(3, .Cells(.Rows.Count, array1(i)).End(xlUp).Row)
- .Range(.Cells(3, array1(i)), .Cells(lastrow, array1(i))).Copy
- Sheets("Sheet2").Range(array2(i) & lastrowDB).PasteSpecial xlPasteValues
- End With
- Next
- Application.CutCopyMode = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement