Comparing spreadsheets

22strider

Active Member
Joined
Jun 11, 2007
Messages
299
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
 

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

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
299
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
299
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
299
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
299
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 :(
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,991
Messages
5,514,665
Members
409,014
Latest member
evenyougreg

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top