Consulting

Results 1 to 9 of 9

Thread: Copy data from Multiple WBs without Duplicates

  1. #1

    Copy data from Multiple WBs without Duplicates

    I have a over a hundred workbooks in "D:\MyReports", each with the same format: (a) column A is a list of all publication dates, (b) column B is a list of all unique reference numbers, (c) sheet name is "source". I need to copy all the unique column B values and their corresponding column A values to a master workbook (sheet name "master") located in another folder: "D:\Master". The hitch is that there are cases where the reference numbers (listed in column B) are sometimes repeated in another workbook, so that a duplicate is created in the master workbook. How do I copy only the unique reference numbers in column B (and their corresponding publication dates - column A) to a master workbook without repetition?

    Column A Column B
    12/1/2016 1234345
    10/3/2016 1345566
    10/3/2016 1344559
    10/1/2016 5391231
    10/2/2016 4856066

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    Copy all the rows over, then when finished use the built-in Remove Duplicates.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    hi p5cal, isn't there another way? there is a lot of data to process. over a hundred workbooks. and there are two columns.

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    Quote Originally Posted by swaggerbox View Post
    isn't there another way? there is a lot of data to process. over a hundred workbooks. and there are two columns.
    Probably, but it would involve a lot more coding. How many rows per workbook? 7k?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    there are many like more than 15k

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    100+ workbooks x rows in each workbook > 1048576?

    Your looking to eliminate duplicates of just column B values, or combinations of duplicate column A with Column B values?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  7. #7
    i am looking to eliminate duplicates of just column B values. The output should be the unique column B values and their corresponding column A values.

  8. #8
    i am looking to eliminate duplicates of just column B values. The output should be the unique column B values and their corresponding column A values.

  9. #9
    VBAX Regular JBeaucaire's Avatar
    Joined
    Sep 2014
    Location
    Bakersfield
    Posts
    32
    Location
    I'm not sure how any suggestion would improve on the one give in post #2. That will be a single line of code added to the end of your existing macro that will execute pretty fast, certainly faster than running numerous checks line by line over 100s of workbooks to insure the duplicates are not copied in the first place.

    I underscore the REMOVE DUPLICATES is certainly the fastest path to the solution for this question.
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •