+ Reply to Thread
Results 1 to 6 of 6

Comparing two columns of data and highlighting - working but one slight issue!

  1. #1
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Comparing two columns of data and highlighting - working but one slight issue!

    Hi guys,

    So I played around with the macro i posted on the previous thread, two allow me to compare two columns of data to see if they contain the same information, and have come up with the below, which works almost flawlessly:

    Please Login or Register  to view this content.
    The idea being that it compares the two rows of data, then in the colmun to the right puts a y or n if the data is contained in both cells. I have added in some code that related to highlighting those cells with 'n' in the allow me to see it much easier. The macro works fine, however it seems that when it runs, it will sometimes highlight random cells not in column d, for example colum g etc.

    Its not a major issue, but as i'm learning, im wondering if someone could maybe explain why this occurs, and how it can be fixed?

    All the best

    Alex

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Comparing two columns of data and highlighting - working but one slight issue!

    try this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Re: Comparing two columns of data and highlighting - working but one slight issue!

    I've added some code in to compare column A to column B and a third column C, to see if the text in column A is contained in either B or C.

    Please Login or Register  to view this content.
    So, i dont know how difficult it would be, but would it be possible to, along with highlighted the "N" in column D, to highlight the Cell where the discrepency may occur, as when comparing 3 columns it maybe useful?

    Again thanks, I love learning from this forum!

    Alex

  4. #4
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Re: Comparing two columns of data and highlighting - working but one slight issue!

    So i sort of figured it out, manipulating the above code.

    Please Login or Register  to view this content.
    Now my next step is, after hightlighting each cell, to copy and paste the "incorrect" row into another column, so i can see a clear list of those accounts that a wrong.... I am truly stumped.

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Comparing two columns of data and highlighting - working but one slight issue!

    Mate, you cannot paste a 'row' into a 'column'. (not unless you mean to transpose )
    You may be able to copy the complete row to a new sheet; or copy a range of cells to a new location (under new columns) in the same sheet. Try manipulating this:
    Please Login or Register  to view this content.
    HTH!

  6. #6
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Re: Comparing two columns of data and highlighting - working but one slight issue!

    Quote Originally Posted by jewelsharma View Post
    Mate, you cannot paste a 'row' into a 'column'. (not unless you mean to transpose )
    You may be able to copy the complete row to a new sheet; or copy a range of cells to a new location (under new columns) in the same sheet. Try manipulating this:
    Please Login or Register  to view this content.
    HTH!
    Appreciated!

    Seeing people write code and learning form it is hugely useful to me!

    Thanks again!

    Alex

    (PS I cant give anymore reputation to you at the moment, it wont allow me to!)

+ 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. Comparing two columns and highlighting values
    By Zaid in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-15-2013, 03:12 AM
  2. Comparing columns and highlighting differences
    By Sejrup in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-01-2010, 09:24 AM
  3. Comparing 2 columns, highlighting the higher number
    By Hagi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2009, 01:17 PM
  4. comparing 2 columns and highlighting text data
    By ghynes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2007, 11:57 AM
  5. [SOLVED] Comparing data in two columns and highlighting the data
    By David Kinsley in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-04-2005, 02:06 PM

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