tanyaleblanc
Board Regular
- Joined
- Mar 16, 2019
- Messages
- 145
Hi, I'm trying to copy column of cells from on column from one workbook to another column on another workbook and paste it in the last blank cell of that column in the new workbook, below, all the data should be pasting in the last cell of each column, most are pasting correctly but some are not. They should paste in cell 50 - 55 of my columns, but some are pasting in cells 56- 61
Code:
Windows("Rental Extract.xls").Activate Range("Q11").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("J" & lrownew).PasteSpecial Paste:=xlPasteValues
Windows("Rental Extract.xls").Activate
Range("R11").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("M" & lrownew).PasteSpecial Paste:=xlPasteValues
Windows("Rental Extract.xls").Activate
Range("N11").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("N" & lrownew).PasteSpecial Paste:=xlPasteValues
Windows("Rental Extract.xls").Activate
lRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("C11:C" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
lrownew = Cells(Rows.Count, "E").End(xlUp).Row + 1
Range("O" & lrownew).PasteSpecial Paste:=xlPasteValues
[B] 'pasted in row 56-61, column O but should have been 50-55, column O[/B]
Windows("Rental Extract.xls").Activate
lRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("B11:B" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
lrownew = Cells(Rows.Count, "E").End(xlUp).Row + 1
Range("P" & lrownew).PasteSpecial Paste:=xlPasteValues
Windows("Rental Extract.xls").Activate
Range("A11:A" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
[B]'same error as above[/B]
Windows("New Rental Contract.xls").Activate
Range("W" & lrownew).PasteSpecial Paste:=xlPasteValues
Windows("Rental Extract.xls").Activate
Range("W11:W" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("Q" & lrownew).PasteSpecial Paste:=xlPasteValues
[B]'same error as above[/B]
Windows("Rental Extract.xls").Activate
Range("X11:X" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("R" & lrownew).PasteSpecial Paste:=xlPasteValues
[B]'same error as above[/B]
Windows("Rental Extract.xls").Activate
Range("Y11:Y" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("U" & lrownew).PasteSpecial Paste:=xlPasteValues
[B]'same error as above[/B]
Windows("Rental Extract.xls").Activate
Range("Z11:Z" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("New Rental Contract.xls").Activate
Range("V" & lrownew).PasteSpecial Paste:=xlPasteValues
[B]'same error as above[/B]