+ Reply to Thread
Results 1 to 4 of 4

Copy most current data row into another sheet

  1. #1
    Registered User
    Join Date
    10-20-2011
    Location
    Montreal, Quebec
    MS-Off Ver
    Excel 2011
    Posts
    2

    Copy most current data row into another sheet

    Hi,

    i am trying to create a macro that will copy the most recent row of data into another sheet, and it should overwrite that sheets row:

    exampe

    Sheet A:

    1 2 3
    a b c
    d e f
    g h i




    Sheet B:
    1 2 3
    g h i




    so basically if i create a new row in sheet A (example: j k l). and run this macro, i want it to delete the row containing g h i in sheet B and replace it with the newest row (or bottom row) that i create in sheet A (in the example, j k l).

    im kind of not even sure where to start.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy most current data row into another sheet

    Assuming,

    1) The last row on Sheet1 with data in column A is the row desired
    2) The target row on Sheet2 is row 1.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-20-2011
    Location
    Montreal, Quebec
    MS-Off Ver
    Excel 2011
    Posts
    2

    Re: Copy most current data row into another sheet

    Quote Originally Posted by JBeaucaire View Post
    Assuming,

    1) The last row on Sheet1 with data in column A is the row desired
    2) The target row on Sheet2 is row 1.

    Please Login or Register  to view this content.
    Worked beautifully, i just modified the range("A1") to A2 because i wanted it to replace the 2nd row on sheet 2 becuase there are headers on row 1.

    Thanks!!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy most current data row into another sheet

    There you go. Glad it worked.

    BTW, resist QUOTING our posts into yours, makes for a messy thread. Just use the Quick Reply Button, or box below.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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