+ Reply to Thread
Results 1 to 13 of 13

Thread: Highlighting differences between two sets of data

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    Posts
    103

    Highlighting differences between two sets of data

    Hi,

    I produce two lists at various times in a month (List A & List B) Id like to compare List B against List A and show:

    1) New names on List B
    2) Any students who have had their Student Status change on list B.

    I have used conditional formatting to do part 1, but Im stuck on part 2. So for example in the attached example I would like:

    The cells I6:N6 in List B to be highlighted red to show that Mary Green has changed from 'On Course' in List A to 'Left' in list B. Both lists would be no more than 565 rows (B3:G565) and (I3:N565)

    Could someone help me please. Ive found variations on here and elsewhere but not quite exactly what I need it to do…Any help would be just

    (edit - apologies, i guess this could/should have gone in the standard forum as it might not need a macro to do this)
    Attached Files Attached Files
    Last edited by Barking_Mad; 11-02-2011 at 11:44 AM. Reason: as per edit note above.

  2. #2
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,299

    Re: Highlighting differences between two sets of data

    Hi.

    Take a look to the attached file.

    Is this what are you looking for?
    Attached Files Attached Files
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  3. #3
    Registered User
    Join Date
    11-02-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Highlighting differences between two sets of data

    Hi,

    You can use the conditional formatting with a furmula.
    This is the formula you can use:

    =$I3<>$N3

    And just than copy your first line and past special the format for the other lines.

    I hopes this helps.

    Joachim

    www.jdrconsultancy.be

  4. #4
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    Posts
    103

    Re: Highlighting differences between two sets of data

    Quote Originally Posted by Fotis1991 View Post
    Hi.

    Take a look to the attached file.

    Is this what are you looking for?
    Hi,

    It works fine on that cell but im having problems duplicating it so it work for the whole of List B.

  5. #5
    Valued Forum Contributor Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds/Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    1,031

    Re: Highlighting differences between two sets of data

    Slightly adapted from here, try this

    Sub kyle()
    
    Dim str As String
    Dim cRow As Integer
    
    
    With Sheets("Find Duplicates")
        For cRow = 3 To .Range("B" & .Rows.Count).End(xlUp).Row
            str = str & Join(Application.Transpose(Application.Transpose(.Cells(cRow, 2).Resize(1, 6))), "|") & "~"
        Next
        For cRow = 3 To .Range("I" & .Rows.Count).End(xlUp).Row
            If InStr(1, str, Join(Application.Transpose(Application.Transpose(.Cells(cRow, 9).Resize(1, 6))), "|") & "~", vbTextCompare) = 0 Then
                .Cells(cRow, 9).Resize(1, 6).Interior.Color = vbRed
            End If
        Next
    End With
    
    End Sub
    Click the * below to say thanks

    Girls sleep with guys who use photoshop, but marry the ones who work with Excel

    Corduroy
    pillows: They're making headlines!

    Did you mean: recursion
    http://www.google.com/search?hl=en&q=recursion

  6. #6
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,299

    Re: Highlighting differences between two sets of data

    Ηι

    You only need to erase the absolute values ​​in cells($)

    See the attached file
    Attached Files Attached Files
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  7. #7
    Registered User
    Join Date
    06-09-2011
    Location
    Leeds, UK
    MS-Off Ver
    MS Office 2007
    Posts
    41

    Re: Highlighting differences between two sets of data

    Both the solutions above are working but if new names appear in list B and the order of the names gets changed compared to list A, then result is not coming as expected.

  8. #8
    Valued Forum Contributor Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds/Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    1,031

    Re: Highlighting differences between two sets of data

    In my code? I'm pretty sure it is?
    Click the * below to say thanks

    Girls sleep with guys who use photoshop, but marry the ones who work with Excel

    Corduroy
    pillows: They're making headlines!

    Did you mean: recursion
    http://www.google.com/search?hl=en&q=recursion

  9. #9
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,299

    Re: Highlighting differences between two sets of data

    Really don't understand what you mean. Can you post me an example?

    Please forgive me, but "computer time" is over for me for Today.

    I'll see it tomorrow morning.
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  10. #10
    Registered User
    Join Date
    06-09-2011
    Location
    Leeds, UK
    MS-Off Ver
    MS Office 2007
    Posts
    41

    Re: Highlighting differences between two sets of data

    Quote Originally Posted by Kyle123 View Post
    In my code? I'm pretty sure it is?
    In list B Student ID 2 is Joanne Smith. replace this entry with a new name say Peter Smith (which is not available in list A) and add Joanne Smith entry at the bottom of list with no change in the student status. Now we have 6 entries in List B where as 5 in List A. Now run your macro. You'll find that Joanne Smith is also highlighted in Red even though the entry in List B is exactly same as List A.This is happening because of the change of order of the names.
    Last edited by Abhijit2011; 11-02-2011 at 11:17 AM.

  11. #11
    Valued Forum Contributor Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds/Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    1,031

    Re: Highlighting differences between two sets of data

    My code works fine on my computer?
    Click the * below to say thanks

    Girls sleep with guys who use photoshop, but marry the ones who work with Excel

    Corduroy
    pillows: They're making headlines!

    Did you mean: recursion
    http://www.google.com/search?hl=en&q=recursion

  12. #12
    Registered User
    Join Date
    06-09-2011
    Location
    Leeds, UK
    MS-Off Ver
    MS Office 2007
    Posts
    41

    Re: Highlighting differences between two sets of data

    Kyle, I've just now run your macro again. I'm getting the result as I explained in my last post. Dont know what's wrong with my system.

  13. #13
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    Posts
    103

    Re: Highlighting differences between two sets of data

    Thanks for all your time, works great

+ 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.2.0