+ Reply to Thread
Results 1 to 6 of 6

Compare two worksheets, find first match and paste, then delete source row

  1. #1
    Registered User
    Join Date
    06-16-2014
    Posts
    16

    Compare two worksheets, find first match and paste, then delete source row

    I have two worksheets and want to paste two cells from the second worksheet (Sheet1) when find the first match in active sheet. Then delete the source row in Sheet1. I can't loop from the last row of the active sheet because I want to populate the first row from the top that matches. I'm also struggling to activate Sheet1 in order to delete the row

    Please Login or Register  to view this content.
    Attached a pic of sheet1 after the code has run...

    sover.jpg

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Compare two worksheets, find first match and paste, then delete source row

    Lot of junks in your code...

    What is the need of this with statement since none of your code uses it...

    Please Login or Register  to view this content.
    Is it i or n??

    Please Login or Register  to view this content.
    Just use this code for this "'need to delete the source row in Sheet1"

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    06-16-2014
    Posts
    16

    Re: Compare two worksheets, find first match and paste, then delete source row

    Oh dear I got the sheet name wrong, it should have been Sheet2 as below. The active sheet is sheet1 but it needs to go to sheet2 to get the matching values as below

    Please Login or Register  to view this content.

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Compare two worksheets, find first match and paste, then delete source row

    Be best to upload an example workbook with your desired output
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compare two worksheets, find first match and paste, then delete source row

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-16-2014
    Posts
    16

    Re: Compare two worksheets, find first match and paste, then delete source row

    Thanks, this is good but I need to think this through a bit more
    Cheers, L

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Compare 2 worksheets and delete the duplicates from just one.
    By Lou54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-27-2012, 08:30 PM
  2. Replies: 6
    Last Post: 05-24-2012, 09:14 AM
  3. Compare worksheets and delete those that don't match
    By Hootie in forum Excel General
    Replies: 3
    Last Post: 07-21-2010, 02:09 PM
  4. compare two worksheets and delete duplicates
    By wali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2010, 09:20 PM
  5. compare two worksheets and delete rows
    By mike.wilson8@comcast.net in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-26-2006, 07:45 PM

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