Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Dim lastrowDB As Long, lastrow As Long
  2. Dim array1, array2, i As Integer
  3.  
  4. With Sheets("Sheet1")
  5. lastrowDB = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
  6. End With
  7.  
  8. array1 = Array("C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N")
  9. array2 = Array("C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N")
  10.  
  11. For i = LBound(array1) To UBound(array1)
  12. With Sheets("Sheet1")
  13. lastrow = Application.Max(3, .Cells(.Rows.Count, array1(i)).End(xlUp).Row)
  14. .Range(.Cells(3, array1(i)), .Cells(lastrow, array1(i))).Copy
  15. Sheets("Sheet2").Range(array2(i) & lastrowDB).PasteSpecial xlPasteValues
  16. End With
  17.  
  18. Next
  19. Application.CutCopyMode = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement