Comparing spreadsheets

22strider

Active Member
Joined
Jun 11, 2007
Messages
307
Hello Friends

Is there a way to compare two spreadsheets for changes and get the changed cells in original sheet highlighted?

I have two spreadsheets; one is the original sheet that we sent out for some modifications. And the other sheet is the modified one. Both have about 1000+ records. I need to compare the two sheets and highlight changes. So that I can put two sheets side by side and see the change (with highlighted changes).

Thanks for your time.
Rajesh
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

kpark91

Well-known Member
Joined
Jul 15, 2010
Messages
1,582
Do they all have same parameters in the correct order with each other?
 

22strider

Active Member
Joined
Jun 11, 2007
Messages
307
Hello kpark91:

Both the sheets have same heading/fields. Basically these are lists of part numbers along with their attributes. So I am trying to identify difference in attributes for individual part numbers.

Yes, both sheets have same fields.

Thanks
Rajesh
 

22strider

Active Member
Joined
Jun 11, 2007
Messages
307
Sorry I forgot to mention that the headings/fields are in same order as well.

Thanks
Rajesh
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690

ADVERTISEMENT

There are several good free add-ins that can do this easily. I like Aaron Blood's at
www.xl-logic.com

lenze
 

22strider

Active Member
Joined
Jun 11, 2007
Messages
307
I checked it has limitations of 30 rows and 10 columns; usefull but may not work for my project.
Thanks for pointing out though.
 

kpark91

Well-known Member
Joined
Jul 15, 2010
Messages
1,582

ADVERTISEMENT

Try this then:

Code:
Sub TEST
    Application.ScreenUpdating = False
 
    Dim lr, lc As Integer
 
    lr = Range("A" & Rows.Count).End(xlUp).Row
    lc = Range("A" & Columns.Count).End(xlLeft).Column
    'In case you want to compare Sheet1 and Sheet2
    For i = 1 to lr Then
        For j = 1 to lc Then 
            If sheet1.Cells(i,j).Value <> Shee2.Cells(i,j).Value Then
                Sheet1.Cells(i,j).Interior.Color = RGB(255,0,0)
            End If
        Next j
    Next i
    Application.ScreenUpdating = True
End Sub
 

22strider

Active Member
Joined
Jun 11, 2007
Messages
307
I am getting syntax error with the following row highlighted:

For i = 1 to lr Then
 

kpark91

Well-known Member
Joined
Jul 15, 2010
Messages
1,582
Erase "Then"
in both For i = 1 to lr Then and For j = 1 to lc Then

My bad :(
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,699
Messages
5,833,201
Members
430,196
Latest member
rez5656

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top