+ Reply to Thread
Results 1 to 8 of 8

compare 2 different excel sheets and output results on 3rd sheet using VBA

  1. #1
    Registered User
    Join Date
    02-05-2024
    Location
    United States
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Exclamation compare 2 different excel sheets and output results on 3rd sheet using VBA

    Using VBA

    I want to compare the email addresses on sheet1 to sheet 2 and output the results on sheet 3.

    Sheet 1 and Sheet 2 have most of the same email addresses with a few extras (different addresses) on each.
    There are extra email addresses on sheet 1 but are not on sheet 2.
    There are extra email addresses on sheet 2 but are not on sheet 1. (Vice versa)

    The results:
    I want the results to output the email addresses from sheet 1, that are missing from sheet 2, labeled as "Not in Sheet 2"
    I want the results to output the email addresses from sheet 2, that are missing from sheet 1, labeled as "Not in sheet 1" (Vice Versa)
    The results from both sheets should output on Sheet 3.


    How would I code this? Thank you!!
    Last edited by AliGW; 03-31-2024 at 08:07 AM. Reason: Screenshots containing potentially sensitive personla data removed.

  2. #2
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    435

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,633

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    1) Formula

    Sheet3
    A2:
    =FILTER(Sheet2!D:D,(Sheet2!D:D<>"")*(ISERROR(MATCH(Sheet2!D:D,Sheet1!B:B,0))))
    B2:
    =FILTER(Sheet1!B:B,(Sheet1!B:B<>"")*(ISERROR(MATCH(Sheet1!B:B,Sheet2!D:D,0))))

    2) vba
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,157

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    ... and one more "something":
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    The screenshots have been removed for now as they appear to contain sensitive personal data that should never be shared in a public online community such as this. Please dezensitise before sharing again
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    02-05-2024
    Location
    United States
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    This is perfect. Thank you!!!!!!!!!!!

  7. #7
    Registered User
    Join Date
    02-05-2024
    Location
    United States
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    I made those names and emails up. I will disclose that next time!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: compare 2 different excel sheets and output results on 3rd sheet using VBA

    Indeed! I was just trying to protect you (and them).

+ 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 2 sheets with output to a 3rd sheet
    By risingflight in forum Excel General
    Replies: 1
    Last Post: 03-31-2022, 05:42 PM
  2. Compare 2 sheets and output difference to 3rd sheet
    By matt-43 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-01-2022, 03:59 AM
  3. Compare values and output cell titles, able to output multiple results
    By TMG2016 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-07-2016, 11:42 AM
  4. Compare two sheets display results in sheet 3
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-11-2014, 07:21 AM
  5. Compare two sheets of Data and output Variance on New Sheet
    By artikyulashun in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-07-2012, 01:51 AM
  6. How to compare two worksheets and output the results
    By MrDisco1 in forum Excel General
    Replies: 1
    Last Post: 03-25-2009, 05:17 PM
  7. Compare data with in a couple of sheets then output to a blank sheet
    By Sabo, Eric in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2006, 11:10 AM

Tags for this Thread

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