Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Paste Cells With Data To Another Sheet

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Paste Cells With Data To Another Sheet

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


DoooWhat wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Paste Cells With Data To Another Sheet

On Jan 31, 10:26 am, Dave Peterson wrote:
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





DoooWhat wrote:

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


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dave:

You rock! Thanks a bunch.

Kevin

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sorting 2 colums of numbers and incremening them down blk&wht Excel Discussion (Misc queries) 10 October 9th 06 10:12 PM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
Inputting data to one worksheet for it effect another daedalus1 Excel Discussion (Misc queries) 1 June 25th 06 04:39 PM
Paste Data into Contiguous (Visible) Cells trev_sk8r New Users to Excel 1 June 16th 06 10:04 PM
populate cells with data from another sheet Pepe_abu Excel Worksheet Functions 0 January 15th 05 08:51 AM


All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"