+ Reply to Thread
Results 1 to 3 of 3

Find most recent matching row and copy subsequent rows between workbooks

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Louisville, IN
    MS-Off Ver
    Excel 2000
    Posts
    2

    Find most recent matching row and copy subsequent rows between workbooks

    I have two workbooks, both with matching headers. Data is entered in one workbook (let's call it workbook1) on a row by row basis with a timestamp of when the data was entered. So each new entry is on the next row down from the previous one with an associated unique timestamp.

    I need a macro in the second workbook (workbook2) that will find the row in workbook1 matching the timestamp of the latest row in its own sheet, and then I need to copy all the new rows that are below it in workbook1.

    ie,

    WORKBOOK1

    MACHINE EMPLOYEE CAUSE TIMESTAMP
    535A 123 Crack 12/12/2012 10:11
    535B 123 Power 12/12/2012 10:15
    61C 423 Damage 12/12/2012 12:23
    535A 123 Crack 12/13/2012 09:53


    WORKBOOK2

    MACHINE EMPLOYEE CAUSE TIMESTAMP
    535A 123 Crack 12/12/2012 10:11
    535B 123 Power 12/12/2012 10:15

    Macro needs to match '12/12/2012 10:15' from workbook2 with workbook1, then copy the subsequent rows to the end of workbook2:

    61C 423 Damage 12/12/2012 12:23
    535A 123 Crack 12/13/2012 09:53

    I am rather stumped. Help would be greatly appreciated.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Find most recent matching row and copy subsequent rows between workbooks

    Here is a macro that should work for you. (see attached files I worked with below)
    Change workbooks and sheets names in the code to suit your files set up.
    Please Login or Register  to view this content.
    Hope this help
    Regards
    Attached Files Attached Files
    Last edited by p24leclerc; 12-12-2012 at 11:06 PM.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Louisville, IN
    MS-Off Ver
    Excel 2000
    Posts
    2

    Re: Find most recent matching row and copy subsequent rows between workbooks

    That is brilliant. Works perfectly. Well done sir.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1