PDA

View Full Version : Comparing 6 coloumn and highlighting the difference



sachin483
10-16-2016, 09:53 PM
i have concatenated the 6 column and compared with other 6 column, but how can I highlight the difference , as I have highlighted in row no.3 & 4

posted in other forum
http://www.mrexcel.com/forum/excel-questions/970542-comparing-6-coloumn-highlighting-difference.html

YasserKhalil
10-16-2016, 11:50 PM
May be

Sub Test() Dim Lr As Long
Dim I As Long
Dim J As Long

Lr = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1:M" & Lr).Interior.Color = xlNone

Application.ScreenUpdating = False
For I = 2 To Lr
For J = 1 To 6
If Cells(I, J).Value <> Cells(I, J).Offset(, 7).Value Then
Cells(I, J).Interior.Color = vbYellow
Cells(I, J).Offset(, 7).Interior.Color = vbYellow
End If
Next J
Next I
Application.ScreenUpdating = True
End Sub

sachin483
10-17-2016, 01:29 AM
Thanks working fine

YasserKhalil
10-17-2016, 02:16 AM
You're welcome. Glad I can offer some help for you