Copy Rows To Worksheet If Cross Match & Another If No Match

  • I have 2 worksheets named sheet1 and need_to_delete that are in the same format:


    7 digit number, 5 digit alpha numeric, text, dollar amount.


    I need to copy every row into sheet2 where there are no matches in the column A of the two source worksheets, and copy every row that does have a match in column A into sheet 3.


    I also need to keep the rows in their current order.

  • Re: Copy Row To One Of Two Worksheets Based On Match Condition


    Here is a clunky way to do it using a macro.


    HTH


    Sorry, I forgot you had 4 columns of data.

  • Re: Copy Row To One Of Two Worksheets Based On Match Condition


    Brian, this looks like it works except for one small problem. It is only copying the column I am comparing. I need to get the whole row. How could I modify this to copy the entire row?


    Also, I seem to have 1 too many entries in the "no match" worksheet, but I think this just may be an issue with how the data was formatted when it was given to me. I had to do some cleanup, and I may have missed something. I am double checking my data too see if it is my fault like I am guessing.

  • Re: Copy Row To One Of Two Worksheets Based On Match Condition


    I don't know if you saw that I edited my post to show how to get all 4 columns of data (the second VB code section). It is a little easier if we can predefine the columns chosen, but if you need that to be variable, let me know.

  • Re: Copy Row To One Of Two Worksheets Based On Match Condition


    Thank you Brian, I ran that, and to me it looks like it did the job. I am going to turn it over to the user to make sure its what she needs.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!