Comparing two sets of data (ranges, rows, columns whatever) and find changes

  • Hi All


    I have a sheet (old version), it has say 4 columns of data on multiple rows (can be thousands).


    On another sheet, I have the same data (new version), however some rows might have changes...


    I need vba code to compare the new data with the old data. If there is a change on a row ideally I want to highlight that row a color (grey for example but I can mess with this later).



    The idea behind it is that a person will have to update the rows, and I want to highlight out the rows that have changed so they don't have to actually update every row every time, but just the ones that have changed.


    I know I can do this with an insane loop, but again I'd like to avoid loops if possible due to the data size and processing time it would take.

  • Re: Comparing two sets of data (ranges, rows, columns whatever) and find changes


    Depends what you mean by "update".
    If you just want to make the old version the same as the new version, why not just make a copy of the new sheet and delete the old?

  • Re: Comparing two sets of data (ranges, rows, columns whatever) and find changes


    There is other data that doesn't change (automatically) in other columns that needs to be manually updated based on the changing data that my code handles.


    So no replacing old with new is not what I need.


    Code/process I need is like this random example:


    OLD DATA
    [TABLE="width: 500"]

    [tr]


    [td]

    QTY

    [/td]


    [td]

    Delivery Date

    [/td]


    [/tr]


    [tr]


    [td]

    5

    [/td]


    [td]

    22/09/16

    [/td]


    [/tr]


    [tr]


    [td]

    10

    [/td]


    [td]

    21/09/16

    [/td]


    [/tr]


    [/TABLE]


    NEW DATA
    [TABLE="width: 500"]

    [tr]


    [td]

    QTY

    [/td]


    [td]

    Delivery Date

    [/td]


    [/tr]


    [tr]


    [td]

    4

    [/td]


    [td]

    22/09/16

    [/td]


    [/tr]


    [tr]


    [td]

    10

    [/td]


    [td]

    24/09/16

    [/td]


    [/tr]


    [/TABLE]


    In these lame examples (there is both more columns to compare and many many more rows), I need code that will compare the data in "NEW DATA" to the data in "OLD DATA"... In these examples it would highlight both rows in "NEW DATA" cause both rows have changed, the QTY on row 2, and the date on row 3.


    If the data was identical, it wouldn't highlight.


    Does that make sense.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!