I found the macro below, I have customised it a bit my self but now I would like to make it fill the entire row gray on both Revised and Original before marking the different cell in yellow.
Thank you,
Sub RunCompare()
Call compareSheets("Revised", "Original")
End Sub
Sub compareSheets(shtRevised As String, shtOriginal As String)
Dim mycell As Range
Dim mydiffs As Integer
'For each cell in Revised that is not the same in Original, color it yellow
For Each mycell In ActiveWorkbook.Worksheets(shtRevised).UsedRange
If Not mycell.Value = ActiveWorkbook.Worksheets(shtOriginal).Cells(mycell.Row, mycell.Column).Value Then
mycell.Interior.Color = vbYellow
mydiffs = mydiffs + 1
End If
Next
'Display a message box to demonstrate the differences
MsgBox mydiffs & " differences found", vbInformation
ActiveWorkbook.Sheets(shtRevised).Select
End Sub
Thank you,
Sub RunCompare()
Call compareSheets("Revised", "Original")
End Sub
Sub compareSheets(shtRevised As String, shtOriginal As String)
Dim mycell As Range
Dim mydiffs As Integer
'For each cell in Revised that is not the same in Original, color it yellow
For Each mycell In ActiveWorkbook.Worksheets(shtRevised).UsedRange
If Not mycell.Value = ActiveWorkbook.Worksheets(shtOriginal).Cells(mycell.Row, mycell.Column).Value Then
mycell.Interior.Color = vbYellow
mydiffs = mydiffs + 1
End If
Next
'Display a message box to demonstrate the differences
MsgBox mydiffs & " differences found", vbInformation
ActiveWorkbook.Sheets(shtRevised).Select
End Sub