Paste Cells With Data To Another Sheet

D

DoooWhat

I am trying to automate a sheet that I will update on a daily basis.
My source (raw data) sheet is a rolling list of bank transactions. I
will paste new data at the bottom of this sheet. Consequently, the
"LastRow" is changing every time I update it.

I want to copy all of the data and paste it to another "Master"
sheet. I cannot figure out the code to select and copy the data from
cell A2 to K(lastrow) on "Raw Data Sheet" and paste it to cell A2 on
"Master Sheet".

I am sure this is a pretty easy fix. Can someone help me out?
Thanks.

Kevin
 
D

Dave Peterson

Option Explicit
Sub testme01()

Dim LastRow as long
dim DestCell as Range
dim RngToCopy as range

with worksheets("Raw Data Sheet")
'column K always has something in it?
'if not, use a different column
lastrow = .cells(.rows.count,"K").end(xlup).row
set rngtocopy = .range("a2:K" & lastrow)
end with

with worksheets("master")
set DestCell = .range("a2")
end with

rngtocopy.copy _
destination:=destcell

end sub
 
D

DoooWhat

Option Explicit
Sub testme01()

Dim LastRow as long
dim DestCell as Range
dim RngToCopy as range

with worksheets("Raw Data Sheet")
'column K always has something in it?
'if not, use a different column
lastrow = .cells(.rows.count,"K").end(xlup).row
set rngtocopy = .range("a2:K" & lastrow)
end with

with worksheets("master")
set DestCell = .range("a2")
end with

rngtocopy.copy _
destination:=destcell

end sub









--

Dave Peterson- Hide quoted text -

- Show quoted text -

Dave:

You rock! Thanks a bunch.

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top