Hi,
I want the list of differences between the two table files to be listed in the other file and I want the master tables to be highlighted in two different colors for differences less than or equal to 1 (orange) and differences more than 1 (yellow). Please find the attached files for an example of how I need it. Previously I got the below mentioned code from this forum but I wanted few more things in a similar fashion.
1. Coloring
2. Finding differences from two different files (previously it was done within the file).
2. If there are any words which are different between the two tables, I get a error message (I only want the values and words needs to be skipped).
Sub Test()
Sheets("Result").Activate
Rows("2:" & Rows.Count).ClearContents
For M = 2 To Sheets("Table 1").Cells(1, Columns.Count).End(xlToLeft).Column
For N = 2 To Sheets("Table 1").Cells(Rows.Count, 1).End(xlUp).Row
If Sheets("Table 1").Cells(N, M) <> Sheets("Table 2").Cells(N, M) Then
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = Cells(Rows.Count, 1).End(xlUp).Row
Cells(Rows.Count, 1).End(xlUp).Offset(0, 1) = Sheets("Table 1").Cells(N, 1) & " - " & Sheets("Table 1").Cells(1, M)
Cells(Rows.Count, 1).End(xlUp).Offset(0, 2) = Sheets("Table 1").Cells(N, M)
Cells(Rows.Count, 1).End(xlUp).Offset(0, 3) = Sheets("Table 2").Cells(N, M)
Cells(Rows.Count, 1).End(xlUp).Offset(0, 4) = Sheets("Table 1").Cells(N, M) - Sheets("Table 2").Cells(N, M)
End If
Next N
Next M
End Sub
Thanks,
Yathish D
Table 1.xlsxTable 2.xlsxTable difference.xlsm
Bookmarks