Assuming 'i' is the number of rows in Sheet1 and 'm' is the number of rows in Sheet2 and 7 headings in each sheets, then this is the solution where the mismatches are registered in Sheet3
Here the Id numbers in Sheet1 is compared with Id numbers in Sheet2 and if present, then they are compared and the mismatches are reported in sheet3 in the same order of the Headings
Sub Mismatch()
Dim temp3 As Integer
temp3 = 1
Dim array1(7), array2(7), array3(7) As Variant
For i = 2 To 6
Worksheets("Sheet1").Activate
For temp = 1 To 7
array1(temp) = Cells(i, temp).Value
Next temp
Worksheets("Sheet2").Activate
For m = 2 To 6
If Cells(m, 1).Value = array1(1) Then
For n = 1 To 7
For temp2 = 1 To 7
array2(temp2) = Cells(m, temp2).Value
Next temp2
Worksheets("Sheet3").Activate
temp3 = temp3 + 1
Cells(temp3, 1).Value = array1(1)
For temp4 = 2 To 7
If array1(temp4) <> array2(temp4) Then
Cells(temp3, temp4).Value = "mismatch"
End If
Next temp4
GoTo JumpToHere
Next n
End If
Next m
JumpToHere:
Next i
End Sub
I Hope this helps
match
orcountif
functions. You don't need VBA for this. Or you can buy a plugin that does this for you. (More reading: Google) – vacip