+ Reply to Thread
Results 1 to 12 of 12

Copy Row if duplicate and Paste to Different Sheet

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Copy Row if duplicate and Paste to Different Sheet

    Looking for a way to have VBA lookup the duplicates in a table (it will be different lengths each time) and copy the duplicate rows to another sheet for further analysis.

    I have attached a file that shows data that is similar.

    Thanks,
    Andy
    Attached Files Attached Files

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,318

    Re: Copy Row if duplicate and Paste to Different Sheet

    Try...

    Please Login or Register  to view this content.
    Last edited by dangelor; 04-29-2012 at 04:20 PM.

  3. #3
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Re: Copy Row if duplicate and Paste to Different Sheet

    Didn't quite work just inserting it and running. Do I need to change some variables so that it will pick up the actual cells?

    It would be nice if it could dump the results to the same spot to make it easy to Vlookup.

    Thanks,
    Andy
    Last edited by AndyIStheMan; 04-29-2012 at 11:36 AM.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,318

    Re: Copy Row if duplicate and Paste to Different Sheet

    The code assumes a Sheet1 and a Sheet2.

  5. #5
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Re: Copy Row if duplicate and Paste to Different Sheet

    Quote Originally Posted by dangelor View Post
    The code assumes a Sheet1 and a Sheet2.
    Tried with a "Sheet2". Inserted code as a module and ran. Sheet 2 remains blank. No change. What might I be messing up? :roll eyes:

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,318

    Re: Copy Row if duplicate and Paste to Different Sheet

    Possibly because there are no duplicate rows. There were none in your attached file. See attached...
    Attached Files Attached Files
    Last edited by dangelor; 04-29-2012 at 02:19 PM.

  7. #7
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Re: Copy Row if duplicate and Paste to Different Sheet

    OK I was asking the wrong question then. I am looking for the duplicates in the column. Then copy the duplicate column values and the other values in the same row as the duplicates.

  8. #8
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,318

    Re: Copy Row if duplicate and Paste to Different Sheet

    Which column?

  9. #9
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Re: Copy Row if duplicate and Paste to Different Sheet

    The Name Column (A).

  10. #10
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,318

    Re: Copy Row if duplicate and Paste to Different Sheet

    Try this one...
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Re: Copy Row if duplicate and Paste to Different Sheet

    That worked for the most part. If I put triplicates or quad unique entries in it, it messes it up. Does it need to loop?

    Is it possible to have it bring over the the all the lookup values as well (first through last)?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-25-2012
    Location
    A Planet Far, Far, Away but yet very near
    MS-Off Ver
    Excel 2011 and 2010
    Posts
    11

    Re: Copy Row if duplicate and Paste to Different Sheet

    Well this worked!

    Please Login or Register  to view this content.

+ 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