+ Reply to Thread
Results 1 to 5 of 5

VBA code for Compare two column and find the unmatch item in another column

  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    4

    Post VBA code for Compare two column and find the unmatch item in another column

    Hi There,

    I have a Workbook with only one sheet. see below:-

    Column Column B Column C
    1 5 1
    2 8 2
    3 0 3
    4 7 4
    5 6 9
    6
    7
    8
    9

    I need a vba code which will compare column A with Column B and list out the unmatch item on Column C. The length of the column differ day to day.

    Thanks a lots in advance!!!

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: VBA code for Compare two column and find the unmatch item in another column

    Hi.

    Try this code:

    comparedata.xlsm
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    03-01-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA code for Compare two column and find the unmatch item in another column

    Quote Originally Posted by jraj1106 View Post
    Hi.

    Try this code:

    Attachment 217609
    Thak you jraj1106

    The above code works fine but in my actuall sheet I have many columns with differnt type of data. While I am adding this this gave me a Typemiss error.

    Can you do it Cells wise Compare instead of range. Something like below:-

    If Cells("A ," & i).value <> Cells("B ," & j).value Then
    we can add it to C column

    Cells("C", i_.value = Cells("A ," & i).value

    Thank you.

  4. #4
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: VBA code for Compare two column and find the unmatch item in another column

    Try this:

    comparedata.xlsm

  5. #5
    Registered User
    Join Date
    03-01-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA code for Compare two column and find the unmatch item in another column

    Hi,

    The above code is not copying the unmatched value to column C. Let me explain little bit clearly whats are my requirements:-

    1. In my privious step I have copied entire column <Reference No> from another workbook<Matser file> and peste it on crrent workbook <Feed file>. Now i want to compare both the refreence no and find out the difference.

    2. The current workbook contains many other coulmn along with two refreence no <One is copy of master file and another is current>

    3. The format of reference no is "**1234567890". <** is countery code> For example IN for India.

    I hope the above description will clear my requirement.

    Thanks a lots in advance!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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