+ Reply to Thread
Results 1 to 5 of 5

vba code to find duplicates in two lists

  1. #1
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76

    vba code to find duplicates in two lists

    hi!

    i have two lists in the attached file, one is my inventory (col A:C) and one is what i want to match it against (col E:F). The results i want from the macro are in columns H:L.

    IM not sure if its possible to write a code for this but... i would like a way to see the duplicate value on the two lists under the ticker columns, meaning if the inventory list has AAPL and the match list has AAPL then AAPL will end u in the result column BUT it will end up there the exact amount of times that it appears on each list so AAPL is on the first list twice and on the second list 2 times so it comes up twice under matches in results and 3 times under needed in the results. the only criteria that needs to be matches is the tickers but i am having difficulty finding ways to align the quantity and counterparty since the amounts can differ on each list. please let me know if you can help with a code for this or a better way. thank you!!!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: vba code to find duplicates in two lists

    It looks like you are just duplicating the two lists, but deleting the unique items in each and lining up in the same rows the matched tickers. Is that correct or am I missing something?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: vba code to find duplicates in two lists

    Hi fruitloop44,
    try it
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76
    Exactly that
    Quote Originally Posted by AlphaFrog View Post
    It looks like you are just duplicating the two lists, but deleting the unique items in each and lining up in the same rows the matched tickers. Is that correct or am I missing something?

  5. #5
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76
    This works!! Thank you!! Can you explain the code?
    I did F8 through it but there's only action in the last few lines so it was hard to follow.

    Quote Originally Posted by nilem View Post
    Hi fruitloop44,
    try it
    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)

Similar Threads

  1. Compare lists of URLs for duplicates, and remove duplicates
    By mrfranklin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2021, 02:54 AM
  2. [SOLVED] Macro to find duplicates, concatenate cells, then delete old duplicates (2)
    By cny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2016, 06:05 AM
  3. Macro to find duplicates, concatenate cells, then delete old duplicates
    By givemepuppies in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-04-2016, 02:43 AM
  4. Replies: 2
    Last Post: 12-27-2013, 09:24 AM
  5. [SOLVED] Macro to find duplicates, concatenate Unique Values, then delete old duplicates
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2013, 04:32 PM
  6. [SOLVED] Find missing code between two lists
    By Berna11 in forum Excel General
    Replies: 3
    Last Post: 03-04-2013, 07:27 AM
  7. [SOLVED] Cross Reference Lists to find Duplicates & List Line Item
    By mycon73 in forum Excel General
    Replies: 3
    Last Post: 01-01-2013, 07:42 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