+ Reply to Thread
Results 1 to 8 of 8

Excel VBA find unmatched

  1. #1
    Registered User
    Join Date
    05-04-2011
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    35

    Excel VBA find unmatched

    I have two worksheets with data and I would like to find unmatched records from Sheet1 to Sheet2 and display on unmatched results in Sheet3. Is there a VBA code to do that? I am novice to programming. Thanks for your help.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Excel VBA find unmatched

    This example checks column A on each sheet and builds a list on Sheet3. Adjust as necessary.


    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Excel VBA find unmatched

    Kinez101,

    Something like this?
    Please Login or Register  to view this content.


    Notes:
    When adjusting this macro to your workbook, make sure to update the following:
    • ResultSheet: This is the sheet that the results will be displayed on. It is Sheet3 in your example.
    • FirstSheet: This is the first sheet that contains data to search through. It is Sheet1 in your example.
    • SecondSheet: This is the second sheet that contains data to search through. It is Sheet2 in your example.
    • FirstSheetDataCol: The macro assumes that the data in the FirstSheet is in column A
    • SecondSheetDataCol: The macro assumes that the data in the SecondSheet is in column A

    Hope that helps,
    ~tigeravatar

  4. #4
    Registered User
    Join Date
    05-04-2011
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Excel VBA find unmatched

    Guys,
    Thank you very much. Both examples worked.

  5. #5
    Registered User
    Join Date
    09-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Excel VBA find unmatched

    Hi folks,

    I need to do something VERY similar, but I have never touched VBA until now (both code examples work great, though as I copied, pasted and ran them).

    Here's my situation:
    Sheet1 has the last names of 150 employees
    Sheet2 has the last names of 78 of those employees who are "Eligible" for a new program at work.

    The result I want on Sheet3 is that same list of 150 employees, with an output of "Eligible" or "Not Eligible" next to their last name.

    So I am doing something similar in that I am looking for matches and non-matches between two lists, but the result I want is the original list with their eligibility "status" in the cell immediately to the right (Column B).

    Any tips, revisions would be WELCOME! Thanks.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Excel VBA find unmatched

    @filetgagnon: welcome to the forum.

    You don't need code for that. You can just add a column to the original sheet with a COUNTIF on the name. If it's 0 then s/he's not eligible.


    Please note though, that you have broken one of the forum rules:


    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

  7. #7
    Registered User
    Join Date
    09-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Excel VBA find unmatched

    Thank you, that worked perfectly.

    So sorry about the rules violation, I was rushing through, and I've only ever viewed forums, never posted or registered - my bad - won't happen again.

    Thanks again!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Excel VBA find unmatched

    You're welcome. No problem. Thanks for the rep.

+ 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