Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sub to append data below existing

I've got source data in sheet: x,
in cols A to I, data from row2 down

In another sheet: y (received daily, for new data)
Data is in cols A to I (identical to x's structure), from row2 down
Col A in y can be used to determine the last data row

I'd like to run a sub to update x with the new data in y. The new data is to
simply append to x's cols A to I, below existing data, determined by last
data row in x's col A


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Sub to append data below existing

Hi,

Right click one of your sheet tabs, view code and paste this in and run it.

Sub mariner()
lastrow = Sheets("Y").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets("Y").Range("A2:I" & lastrow).Copy
lastrow = Sheets("X").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Sheets("X").Range("A" & lastrow + 1).PasteSpecial
End Sub

Mike

"Max" wrote:

I've got source data in sheet: x,
in cols A to I, data from row2 down

In another sheet: y (received daily, for new data)
Data is in cols A to I (identical to x's structure), from row2 down
Col A in y can be used to determine the last data row

I'd like to run a sub to update x with the new data in y. The new data is to
simply append to x's cols A to I, below existing data, determined by last
data row in x's col A



  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sub to append data below existing

Many thanks, Mike. Works great.
(I installed into a std module)


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
Append existing cell value Gnerks Excel Programming 2 October 23rd 07 11:41 AM
Automatically Append New Data in Unknown Addresses into Existing Ranges Arnold[_3_] Excel Programming 0 January 10th 07 09:50 AM
Simple code to append numbers to the existing data in the cells Hemang Shah Excel Programming 1 June 23rd 06 06:02 AM
How do I paste to append instead of replace existing data? Joel Thomas Excel Discussion (Misc queries) 1 October 3rd 05 01:32 PM
How to append existing series? Michael C via OfficeKB.com Charts and Charting in Excel 1 August 20th 05 03:17 PM


All times are GMT +1. The time now is 02:24 PM.

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

About Us

"It's about Microsoft Excel"