+ Reply to Thread
Results 1 to 4 of 4

Compare two columns

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    Durham England
    Posts
    6

    Compare two columns

    Hi,
    there's an excellent example here on this site of how to compare two columns. This example, however, returns which rows that don't have matching data.
    I'm looking to compare two columns that have data supplied in no particular order. I need to know what is in column A that isn't in column B, & similarly I'd like to know what's in Column B that isn't in column A. I'd like to print the results in Sheet3.
    I guess it's easier said than done
    I need to do this with VBA as opposed to formula.
    Can anyone point me in the right direction please?

    http://www.exceltip.com/st/Compare_t...Excel/476.html

  2. #2
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Compare two columns: Formula

    It is easy to do with a formula, but I suppose you don't what that, since you wrote "I need to do this with VBA as opposed to formula".

    With formula:
    =IF(ISNUMBER(MATCH(Sheet1!B2;Sheet1!$A$2:$A$25;0));"";Sheet1!B2&" is missing in column A. ")&IF(ISNUMBER(MATCH(Sheet1!A2;Sheet1!$B$2:$B$25;0));"";Sheet1!A2&" is missing in column B. ")
    With VBA:
    Please Login or Register  to view this content.
    From:http://www.mrexcel.com/forum/showthread.php?t=330477

    Hope this helped
    //Ola

  3. #3
    Registered User
    Join Date
    07-16-2008
    Location
    Durham England
    Posts
    6
    Thank you very much olasa

  4. #4
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    ..

    Thanks for the feedback
    //Ola

+ 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