RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 790
- Office Version
- 365
- Platform
- Windows
Hi, colleague asked me this and I've seen it before but can't successfully google what I want.
Basically in a single copy operation from one sheet to another you can say, for instance:
That's the normal way, or one of them.
What I want to know is how to paste to the bottom of the data set, without setting a new last row. If that above code was in a loop I'd have to switch to the temp tab and re-define the last row each time.
While computationally it takes no time at all, is it not better practice to cut down unnecessary code and instead paste like this:
When I try this, nothing is pasted. Any help? Thanks.
Basically in a single copy operation from one sheet to another you can say, for instance:
VBA Code:
Range("A2").copy Destination:=temp.range("A" & Lastrow + 1)
That's the normal way, or one of them.
What I want to know is how to paste to the bottom of the data set, without setting a new last row. If that above code was in a loop I'd have to switch to the temp tab and re-define the last row each time.
While computationally it takes no time at all, is it not better practice to cut down unnecessary code and instead paste like this:
VBA Code:
Range("A2").copy Destination:=temp.cells(rows.count, "A").end(xlup).row + 1
When I try this, nothing is pasted. Any help? Thanks.