Macro To Compare Two Excel WorkSheets And Copy Different Rows To New WorkSheet

Previously, we wrote a macro on comparing two excel worksheet, highlight duplicate entries and copy duplicates to a new worksheet. Some of our readers were looking for a macro that compares two excel worksheets, highlight different entries and copy differences to a new worksheet.

Note: To find out the detailed steps on how to create, run or edit a macro, you may refer here or here for excel 2007.

Few Points Worth To Note:

  • While creating the Macro, ensure that name of the macro is kept as “Compare”
  • Worksheet names are considered to be “Sheet1″, “Sheet2″ and “Sheet3″
  • Different rows are highlighted in Sheet1 and copied to Sheet3

Hope you find this solution useful, your suggestions, feedback and comments are always welcome.

  1. Hi Admin,

    Once again thank you dearly for the assistance you have giving me so far, however my issue is not quiet solved, nearly there (“,)

    Tried this code and again, nothing happens, left it for a good 5-10 mins but nothing, so I’ve used task manager to crash out of it. This time there is no option to recover the file, so I cant debug to see were the error lies.

    Therefore please may I ask for you assistance hopefully one last time in getting this one up and running as this will defiently suit my needs (“,)

    thanks again,
    Andi x

  2. Hi Andi,

    As we told if data is huge, it will take sometime to compute the difference, after all we are comparing each cell of Sheet 1 with nearly each cell of Sheet 2.

    However, do let us know if you see Status Bar at the bottom left getting updated?

    Regards

  3. Can you try this macro with small subset of your data and see if it works? This will ensure that issue is not with the code but the time it takes.

  4. This code works great. I would like to copy rows associated only with differences found in a certain column though. Not quite sure how to modify the code for this. Any input would be great.

  5. Hi Jay,

    Thank you for the feedback. Below code should work for you. You need to update value of “col” variable to the column index against which you want to compare. Currently it is set as 2.

    Sub Compare()

    ‘ Macro1 Macro

    ‘ compare two different worksheets in the active workbook
    CompareWorksheets Worksheets(“Sheet1″), Worksheets(“Sheet2″)
    End Sub

    Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet)
    Dim dupRow As Boolean
    Dim r As Long, c As Integer, m As Integer
    Dim lr1 As Long, lr2 As Long, lc1 As Integer, lc2 As Integer, lr3 As Long
    Dim maxR As Long, maxC As Integer, cf1 As String, cf2 As String
    Dim dupCount As Long
    Dim col As Integer

    col = 2

    Application.ScreenUpdating = False
    Application.StatusBar = “Creating the report…”
    Application.DisplayAlerts = True
    With ws1.UsedRange
    lr1 = .Rows.Count
    lc1 = .Columns.Count
    End With
    With ws2.UsedRange
    lr2 = .Rows.Count
    lc2 = .Columns.Count
    End With
    maxR = lr1
    maxC = lc1
    If maxR < lr2 Then maxR = lr2
    If maxC < lc2 Then maxC = lc2
    DiffCount = 0
    lr3 = 1
    For i = 1 To lr1
    dupRow = True
    Application.StatusBar = "Comparing worksheets " & Format(i / maxR, "0 %") & "..."
    For r = 1 To lr2
    ws1.Select
    cf1 = ""
    cf2 = ""
    On Error Resume Next
    cf1 = ws1.Cells(i, col).FormulaLocal
    cf2 = ws2.Cells(r, col).FormulaLocal
    On Error GoTo 0
    If cf1 <> cf2 Then
    dupRow = False
    Else
    dupRow = True
    End If
    If dupRow Then
    Exit For
    End If
    Next r
    If Not dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet3″).Select
    Worksheets(“Sheet3″).Range(Worksheets(“Sheet3″).Cells(lr3, 1), Worksheets(“Sheet3″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next i
    Application.StatusBar = “Formatting the report…”
    ‘Columns(“A:IV”).ColumnWidth = 10
    m = dupCount
    Application.StatusBar = False
    Application.ScreenUpdating = True
    MsgBox m & ” Rows contain different values for column ” & col & “!”, vbInformation, _
    “Compare ” & ws1.Name & ” with ” & ws2.Name
    End Sub

  6. Hi
    This one i tried.. it works good, but i have annother doubt. i have two excel sheets in the same workbook. Sheet1& sheet2. sheet1 is compared against sheet2, where “Sheet1″ is the base sheet. some records are different and most important they are not in the same cells or in same order as sheet1. The Cells are compared using a column say “Name” in sheet1 against name in sheet2. If sheet2 has the same data in each cell against that column” Name” Then the result should be in “true”or “False” format in sheet3. If “true” then highlight it with green colour and if “false” orange colour. This “true” or “false” should be in the same order of data which is in sheet1. I’l show a simple example of what i want:

    Sheet1
    1.Name Age fav-No
    2.mary 14 1
    3.ann 15 3
    4.mike 13 5
    5.jude 15 3
    6.jim 16 2

    Sheet2
    1.Name Age fav-No
    2.tom 14 1
    3.mike 13 5
    4.ann 15 3
    5.jim 16 2

    Sheet3
    1.Name Age fav-No
    2.false true true//since”mary” is not in “sheet2″
    3.true true true //since “ann” is in 3rd row in “sheet1″ it is placed in 3rd row in “sheet3″
    4.true true true//since “mike” is in 4th row in “sheet1″
    5. //since “jude” is not present in “sheet2″ leave it blank space in “sheet3″
    6. true true true//since “jim” is in “6th” row in “sheet1″

    please help me in this as soon as possible as i have no idea about Macros…gayunana01

    Posts: 1
    Joined: Jul 9, 2012
    Excel Version: 2007

  7. Hi,

    If we have, for example, in column A name of parameter, and in column B values, can we have in Sheet3 values from both sheets (column B) in two different columns?

    Regards,

  8. Hello I am looking for something similar.
    I have 2 sheets Sheet1 & Sheet2 and both have sales reports from August and September. I want to compare Column G on both and if a “Nil” value or empty cell is found in Sheet2 I want to report that row onto Sheet3 so I can review them without having to cross reference them manually. I am unfortunately an excel dummy and have only figured how to do the =IF(Sheet1!G4=Sheet2!G4,”",”X”) and it does display an “X” in the third sheet but it will compare the values of the cells so different sales #’s will return an “X” into the third sheet. I just need it to copy the Row in Sheet2 that shows a zero value when compared to Sheet1 into the Sheet3 so I can print it off. Please please help!

  9. Hi,
    This code works really great. :) Thanks a lot…!
    But, I have to compare 2 large Excel worksheets, containing around 15 columns & 10,000 rows. For this, it is taking around 2.5 hrs to compare. To make it a bit faster, can there be any modification (avoiding nested loops)/ or any alternate solution. Please help…!!!

  10. Hi Mac,

    Thank you for the feedback, we appreciate it.

    Code is well optimized already. However, if you do not want to highlight the non-duplicate rows, you may remove below piece of code from above macro, it might improve the performance to some extent:

    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t

    Let us know if we can help you further.

    Regards

    • Thanks a lot for your Quick response!
      But, removing that is not making any difference. It is taking the same time. I was feeling if the nested loops for cell by cell comparison could be avoided somehow, by comparing ranges. It might help!
      The result we’re getting is perfect right now, the only thing is- it’s taking too much time to process. This is a limitation for this macro to be implemented. Appreciate if you people could help further…!
      Thanks!

      • Hi Mac,

        Whatever solution we might use, it will internally do a cell to cell comparison to find non-duplicates.

        We have sent you an email, please check.

        Regards

  11. Hi,

    Thanks for giving the valuable information.
    I have gone through the code for “Macro To Compare Two Excel WorkSheets And Copy Different Rows To New WorkSheet” and “Macro To Compare Two Excel WorkSheets And Copy Duplicate Rows To New WorkSheet”. Its been very useful. but when I tried to merge the two codes to get both duplicate and different records as follows, I am getting wrong output.

    Sub diff()

    ‘ Macro1 Macro

    ‘ compare two different worksheets in the active workbook
    CompareWorksheets Worksheets(“Sheet1″), Worksheets(“Sheet2″)
    End Sub

    Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet)
    Dim dupRow As Boolean
    Dim r As Long, c As Integer, m As Integer
    Dim lr1 As Long, lr2 As Long, lc1 As Integer, lc2 As Integer, lr3 As Long
    Dim maxR As Long, maxC As Integer, cf1 As String, cf2 As String
    Dim dupCount As Long

    Application.ScreenUpdating = False
    Application.StatusBar = “Creating the report…”
    Application.DisplayAlerts = True
    With ws1.UsedRange
    lr1 = .Rows.Count
    lc1 = .Columns.Count
    End With
    With ws2.UsedRange
    lr2 = .Rows.Count
    lc2 = .Columns.Count
    End With
    maxR = lr1
    maxC = lc1
    If maxR < lr2 Then maxR = lr2
    If maxC < lc2 Then maxC = lc2
    DiffCount = 0
    lr3 = 1
    For i = 1 To lr1
    dupRow = True
    Application.StatusBar = "Comparing worksheets " & Format(i / maxR, "0 %") & "…"
    For r = 1 To lr2
    For c = 1 To maxC
    ws1.Select
    cf1 = ""
    cf2 = ""
    On Error Resume Next
    cf1 = ws1.Cells(i, c).FormulaLocal
    cf2 = ws2.Cells(r, c).FormulaLocal
    On Error GoTo 0
    If cf1 cf2 Then
    dupRow = False
    Exit For
    Else
    dupRow = True
    End If
    Next c
    If dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet4″).Activate
    Worksheets(“Sheet4″).Select
    Worksheets(“Sheet4″).Range(Worksheets(“Sheet4″).Cells(lr3, 1), Worksheets(“Sheet4″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next r
    If Not dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet3″).Select
    Worksheets(“Sheet3″).Range(Worksheets(“Sheet3″).Cells(lr3, 1), Worksheets(“Sheet3″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next i
    Application.StatusBar = “Formatting the report…”
    ‘Columns(“A:IV”).ColumnWidth = 10
    m = dupCount
    Application.StatusBar = False
    Application.ScreenUpdating = True
    MsgBox m & ” Rows contain different values!”, vbInformation, _
    “Compare ” & ws1.Name & ” with ” & ws2.Name
    End Sub

    Please help me out.

  12. Hi,

    Thanks for giving the valuable information.
    I have gone through the code for “Macro To Compare Two Excel WorkSheets And Copy Different Rows To New WorkSheet” and “Macro To Compare Two Excel WorkSheets And Copy Duplicate Rows To New WorkSheet”. Its been very useful. but when I tried to merge the two codes to get both duplicate and different records as follows, I am getting wrong output.

    Sub diff()

    ‘ Macro1 Macro

    ‘ compare two different worksheets in the active workbook
    CompareWorksheets Worksheets(“Sheet1″), Worksheets(“Sheet2″)
    End Sub

    Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet)
    Dim dupRow As Boolean
    Dim r As Long, c As Integer, m As Integer
    Dim lr1 As Long, lr2 As Long, lc1 As Integer, lc2 As Integer, lr3 As Long
    Dim maxR As Long, maxC As Integer, cf1 As String, cf2 As String
    Dim dupCount As Long

    Application.ScreenUpdating = False
    Application.StatusBar = “Creating the report…”
    Application.DisplayAlerts = True
    With ws1.UsedRange
    lr1 = .Rows.Count
    lc1 = .Columns.Count
    End With
    With ws2.UsedRange
    lr2 = .Rows.Count
    lc2 = .Columns.Count
    End With
    maxR = lr1
    maxC = lc1
    If maxR < lr2 Then maxR = lr2
    If maxC < lc2 Then maxC = lc2
    DiffCount = 0
    lr3 = 1
    For i = 1 To lr1
    dupRow = True
    Application.StatusBar = "Comparing worksheets " & Format(i / maxR, "0 %") & "…"
    For r = 1 To lr2
    For c = 1 To maxC
    ws1.Select
    cf1 = ""
    cf2 = ""
    On Error Resume Next
    cf1 = ws1.Cells(i, c).FormulaLocal
    cf2 = ws2.Cells(r, c).FormulaLocal
    On Error GoTo 0
    If cf1 cf2 Then
    dupRow = False
    Exit For
    Else
    dupRow = True
    End If
    Next c
    If dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet4″).Activate
    Worksheets(“Sheet4″).Select
    Worksheets(“Sheet4″).Range(Worksheets(“Sheet4″).Cells(lr3, 1), Worksheets(“Sheet4″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next r
    If Not dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet3″).Select
    Worksheets(“Sheet3″).Range(Worksheets(“Sheet3″).Cells(lr3, 1), Worksheets(“Sheet3″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next i
    Application.StatusBar = “Formatting the report…”
    ‘Columns(“A:IV”).ColumnWidth = 10
    m = dupCount
    Application.StatusBar = False
    Application.ScreenUpdating = True
    MsgBox m & ” Rows contain different values!”, vbInformation, _
    “Compare ” & ws1.Name & ” with ” & ws2.Name
    End Sub

    Please help me out.

  13. Hi,

    Thanks for giving the valuable information.
    I have gone through the code for “Macro To Compare Two Excel WorkSheets And Copy Different Rows To New WorkSheet” and “Macro To Compare Two Excel WorkSheets And Copy Duplicate Rows To New WorkSheet”. Its been very useful. but when I tried to merge the two codes to get both duplicate and different records as follows, I am getting wrong output.

    Sub diff()

    ‘ Macro1 Macro

    ‘ compare two different worksheets in the active workbook
    CompareWorksheets Worksheets(“Sheet1″), Worksheets(“Sheet2″)
    End Sub

    Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet)
    Dim dupRow As Boolean
    Dim r As Long, c As Integer, m As Integer
    Dim lr1 As Long, lr2 As Long, lc1 As Integer, lc2 As Integer, lr3 As Long
    Dim maxR As Long, maxC As Integer, cf1 As String, cf2 As String
    Dim dupCount As Long

    Application.ScreenUpdating = False
    Application.StatusBar = “Creating the report…”
    Application.DisplayAlerts = True
    With ws1.UsedRange
    lr1 = .Rows.Count
    lc1 = .Columns.Count
    End With
    With ws2.UsedRange
    lr2 = .Rows.Count
    lc2 = .Columns.Count
    End With
    maxR = lr1
    maxC = lc1
    If maxR < lr2 Then maxR = lr2
    If maxC < lc2 Then maxC = lc2
    DiffCount = 0
    lr3 = 1
    For i = 1 To lr1
    dupRow = True
    Application.StatusBar = "Comparing worksheets " & Format(i / maxR, "0 %") & "…"
    For r = 1 To lr2
    For c = 1 To maxC
    ws1.Select
    cf1 = ""
    cf2 = ""
    On Error Resume Next
    cf1 = ws1.Cells(i, c).FormulaLocal
    cf2 = ws2.Cells(r, c).FormulaLocal
    On Error GoTo 0
    If cf1 cf2 Then
    dupRow = False
    Exit For
    Else
    dupRow = True
    End If
    Next c
    If dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet4″).Activate
    Worksheets(“Sheet4″).Select
    Worksheets(“Sheet4″).Range(Worksheets(“Sheet4″).Cells(lr3, 1), Worksheets(“Sheet4″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next r
    If Not dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet3″).Select
    Worksheets(“Sheet3″).Range(Worksheets(“Sheet3″).Cells(lr3, 1), Worksheets(“Sheet3″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next i
    Application.StatusBar = “Formatting the report…”
    ‘Columns(“A:IV”).ColumnWidth = 10
    m = dupCount
    Application.StatusBar = False
    Application.ScreenUpdating = True
    MsgBox m & ” Rows contain different values!”, vbInformation, _
    “Compare ” & ws1.Name & ” with ” & ws2.Name
    End Sub

    Please help me out.

  14. Hello I also like the first code. that compares two excelsheets. I use this to compare to see if vallues are chnage between “old” and “new” The row that is changes comes back on the 3rd sheet called “Changes” Is it possible to get the headers back on the “Changed” sheet and is it possible to higlight on “Changed” sheet the cell of the changed value. So that I can look up the line in another system and only change the higlighted value, instead ov checking 16 colums what has been chnaged (i hope i make clear what i whant, English is not my native language)

  15. Hi,i tried using your code,but the problem is if i have same number of rows in the sheet1 and sheet 2 then the comparision is gud.but if i have different rows in sheet 1 and sheet 2,the comparision takes place with respect to sheet 1 and the rows not in sheet 1 and present in sheet 2 are left out.can you please advise.

    thanks,
    -L

  16. Hi

    I too would be interested in learning how to modify Macro so that on sheet 3 only the cell that has changed in row is hilighted, alternatively if it could copy original entry from sheet 2 above changed entry in sheet 1 on sheet-to allow quick check of change

  17. Also noticed that it only flags differences in values or new entries.
    It doesn’t flag entries that were on sheet 2 but not on Sheet1?

  18. Hi L/Alison,

    This particular macro compares sheet 1 data with sheet 2 and copies rows that are new to sheet 1 to sheet 3. It does not compare sheet 2 data with sheet 1.

    For any customized solution, please leave your query at and we will get back to you as soon as possible.

    http://verticalhorizons.in/ask-excel/

    Regards
    Admin

  19. Hello, for some reason this code will not compile when I copy/paste it… how do I get it to compile and actually run? I also have a large amount of data 15,000 rows per sheet. Please get back to me asap

  20. Hello, for some reason this code will not compile when I copy/paste it… how do I get it to compile and actually run? I also have a large amount of data 15,000 rows per sheet. Please get back to me asap

  21. Hello! I have to compare 2 columns in a worksheet A ( A and B) with 2 Columns ( A and B) in Worksheet B and flag any difference between both the worksheets! Can I please have the customized code for this please? Your help is greatly appreciated! Thanks in advance!

    • Hi, Many thaks for putting up the code. Your reply to Jay with the edited version is exactly what I need and worked perfect. Cheers

  22. When I first tried the “Macro To Compare Two Excel WorkSheets And Copy Different Rows To New WorkSheet” I got an error that led me to change the names of the worksheets back to the original Sheet 1 and Sheet 2. I was still getting an error, so I started over and now I am getting an error that it is running in break mode, with the line
    Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet) showing as the problem. I can’t figure out why it is in break mode, and I can’t even step through the code to see what the hold up is. My test data is 28 rows, copied identically from sheet 1 and sheet 2, with minor differences added in for test purposes. I cut and pasted the macro exactly, updated the trust center in Excel 2010 to allow macros, and I can’t get it to run. Any help would be appreciated.

    Sub Compare()

    ‘ Macro1 Macro

    ‘ compare two different worksheets in the active workbook
    CompareWorksheets Worksheets(“Sheet1″), Worksheets(“Sheet2″)
    End Sub

    Sub CompareWorksheets(ws1 As Worksheet, ws2 As Worksheet)
    Dim dupRow As Boolean
    Dim r As Long, c As Integer, m As Integer
    Dim lr1 As Long, lr2 As Long, lc1 As Integer, lc2 As Integer, lr3 As Long
    Dim maxR As Long, maxC As Integer, cf1 As String, cf2 As String
    Dim dupCount As Long

    Application.ScreenUpdating = False
    Application.StatusBar = “Creating the report…”
    Application.DisplayAlerts = True
    With ws1.UsedRange
    lr1 = .Rows.Count
    lc1 = .Columns.Count
    End With
    With ws2.UsedRange
    lr2 = .Rows.Count
    lc2 = .Columns.Count
    End With
    maxR = lr1
    maxC = lc1
    If maxR < lr2 Then maxR = lr2
    If maxC < lc2 Then maxC = lc2
    DiffCount = 0
    lr3 = 1
    For i = 1 To lr1
    dupRow = True
    Application.StatusBar = "Comparing worksheets " & Format(i / maxR, "0 %") & "…"
    For r = 1 To lr2
    For c = 1 To maxC
    ws1.Select
    cf1 = ""
    cf2 = ""
    On Error Resume Next
    cf1 = ws1.Cells(i, c).FormulaLocal
    cf2 = ws2.Cells(r, c).FormulaLocal
    On Error GoTo 0
    If cf1 cf2 Then
    dupRow = False
    Exit For
    Else
    dupRow = True
    End If
    Next c
    If dupRow Then
    Exit For
    End If
    Next r
    If Not dupRow Then
    dupCount = dupCount + 1
    ws1.Range(ws1.Cells(i, 1), ws1.Cells(i, maxC)).Select
    Selection.Copy
    Worksheets(“Sheet3″).Select
    Worksheets(“Sheet3″).Range(Worksheets(“Sheet3″).Cells(lr3, 1), Worksheets(“Sheet3″).Cells(lr3, maxC)).Select
    Selection.PasteSpecial
    lr3 = lr3 + 1
    ws1.Select
    For t = 1 To maxC
    ws1.Cells(i, t).Interior.ColorIndex = 19
    ws1.Cells(i, t).Select
    Selection.Font.Bold = True
    Next t
    End If
    Next i
    Application.StatusBar = “Formatting the report…”
    ‘Columns(“A:IV”).ColumnWidth = 10
    m = dupCount
    Application.StatusBar = False
    Application.ScreenUpdating = True
    MsgBox m & ” Rows contain different values!”, vbInformation, _
    “Compare ” & ws1.Name & ” with ” & ws2.Name
    End Sub

  23. Hi Admin.

    thanks for all your effective codes. i have one more doubt.

    you are comparing two excel sheets with equal number of rows.
    if sheet1/sheet2 have more number of rows when compared to other, its not comparing .

    Any solutions please

  24. Hi Admin, This code works great and its the best comparing software ive found on the internet and its helped me loads. I was wondering is there anyway that the Macro can just compare two columns? i.e E and F in worksheet1 against E and F in worksheet2 and then move the different columns A to F and rows into worksheet3.

    Many thanks,
    Richard

  25. I think that everything posted was actually very reasonable.
    But, what about this? suppose you were to write a
    awesome post title? I am not suggesting your information isn’t good.,
    however suppose you added a headline to maybe get people’s attention? I mean Macro To
    Compare Two Excel WorkSheets And Copy Different Rows To New WorkSheet | Vertical Horizons is
    kinda vanilla. You ought to look at Yahoo’s home page and note how they create news titles to grab people
    to click. You might add a related video or a related pic or two
    to get people excited about everything’ve written. Just my opinion, it could make your posts a little bit more interesting.

  26. Your article is well written ! However, the design of your website doesnt show up properly under the web browser SEWER NecroPedoSadoMaso 3.3 which is really a shame… hope you can find a way to fix it !

  27. Hello there, You have done an excellent job. I’ll definitely digg it and personally suggest to my friends.

    I’m confident they’ll be benefited from this website.

Leave a Reply to Joe Cancel reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">