Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I need to copy and paste all the rows from sheet Two to sheet One (beginning from the first empty row).
At the moment, the copy and paste works for only one row.
Where is the mistake?
Thank's.
I need to copy and paste all the rows from sheet Two to sheet One (beginning from the first empty row).
At the moment, the copy and paste works for only one row.
Where is the mistake?
Thank's.
Code:
Sub transfer()
Dim lr As Long, lr2 As Long, r As Long
lr = Sheets("Two").Cells(Rows.Count, "A").End(xlUp).Row
lr2 = Sheets("One").Cells(Rows.Count, "A").End(xlUp).Row
For r = lr To 2 Step -1
Rows(r).Copy Destination:=Sheets("One").Range("A" & lr2 + 1)
Next r
End Sub
Last edited: