+ Reply to Thread
Results 1 to 10 of 10

Check two lists on separate worksheets and copy only unique values

  1. #1
    Registered User
    Join Date
    03-17-2011
    Location
    Atlanta
    MS-Off Ver
    Excel for Office 365
    Posts
    38

    Check two lists on separate worksheets and copy only unique values

    Hello,

    I have a macro that works for the task at hand, but takes a very long time to complete.

    I am comparing project numbers (roughly 8 to 10 each day) for every single day of the week from January 1, 2017 through September 30, 2017. The code is designed to review a detailed list which has duplicates, due to projects needing to be entered on different days to account for the time spent working on the project each day, and FilterCopy only the unique values so the project number is only listed one time on a summary report. The summary report takes all the details from the individual entries and aggregates them into a report where the user can clearly see how much time has been spent on the project each day, month and in total.

    I ran the macro this morning, for data from January 1, 2017 through September 30, 2017 and it took 10-15 minutes just to complete the comparison and copy unique values. Does anyone have suggestions on how to improve the code, or a more resource efficient suggestion?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Check two lists on separate worksheets and copy only unique values

    Hi physicsgal

    Please upload a sample file so that we can see actual scenario...Am very certain that we can come up with a more efficient code...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Check two lists on separate worksheets and copy only unique values

    Hi PhysicsGal,

    See the attached where I tried to repro your problem. Column A (on both sheets) are 100 random numbers from 1 to 200. Then in Column B (on both sheets) is the count of the number of duplicate summed. Only column B that has a 1 are the unique numbers.

    I have no idea what your data looks like to give much of a better guess on what you are looking for. I'd not use VBA unless really needed.

    Find Unique between two sheets.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    03-17-2011
    Location
    Atlanta
    MS-Off Ver
    Excel for Office 365
    Posts
    38

    Re: Check two lists on separate worksheets and copy only unique values

    Thanks for the offers! I will work on a blinded data set that I can upload for others to review. Because of the nature of our business, I cannot disclose client names or project details (which are included in my file).

    MarvinP - I will also take a look at the sample file you uploaded to see if that will work to solve my problem.

  5. #5
    Registered User
    Join Date
    03-17-2011
    Location
    Atlanta
    MS-Off Ver
    Excel for Office 365
    Posts
    38

    Post Re: Check two lists on separate worksheets and copy only unique values

    I have attached the file for review. The goal is to take the details on the "NS Detail" tab and summarize them by project onto the "Time Report" tab. To run the macro, Press Ctrl+Shift+L in cell A4 on the Time Report. It will take several minutes to run so don't do it unless you have some time on your hands to wait it out.

    Thanks!
    Attached Files Attached Files

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Check two lists on separate worksheets and copy only unique values

    Hi Jess,

    Maybe I'm wrong but it looks as though you're just repeating the same paste 696 times!

    Try this and let me know:

    Please Login or Register  to view this content.
    Last edited by xladept; 10-18-2017 at 11:53 AM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  7. #7
    Registered User
    Join Date
    03-17-2011
    Location
    Atlanta
    MS-Off Ver
    Excel for Office 365
    Posts
    38

    Re: Check two lists on separate worksheets and copy only unique values

    *Face palm* You were definitely right!

    Thanks for the assist
    Last edited by physicsgal; 10-18-2017 at 12:08 PM. Reason: Tried code to confirm results

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Check two lists on separate worksheets and copy only unique values

    You're welcome and thanks for the rep!

    *I couldn't imagine how the code could be any more elegant - so I got "outside the box"

  9. #9
    Registered User
    Join Date
    03-17-2011
    Location
    Atlanta
    MS-Off Ver
    Excel for Office 365
    Posts
    38

    Re: Check two lists on separate worksheets and copy only unique values

    That's what I needed! Thanks, again.

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Check two lists on separate worksheets and copy only unique values

    You're welcome again, and, nice code there

+ 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] Copy Non-BlankValues of 3 Worksheets and Paste Unique Values
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2013, 06:56 PM
  2. [SOLVED] Check data on two worksheets and copy unique rows
    By Burt_100 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-05-2013, 04:21 PM
  3. Validation Lists - Multiple dependent lists with unique values
    By Lewigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 06:42 AM
  4. [SOLVED] Compare two lists and copy unique values to the second list
    By Brumbot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-06-2013, 07:36 AM
  5. LISTS! identifying unique values in multiple lists
    By pwall1115 in forum Excel General
    Replies: 3
    Last Post: 04-09-2013, 03:36 AM
  6. [SOLVED] LISTS! how to identify which values are unique in multiple lists
    By pwall1115 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-08-2013, 10:43 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