Option Explicit
Sub TimTrung()
Dim bRw As Long, Jj As Long
Dim Rng As Range, sRng As Range, cRng As Range
Application.ScreenUpdating = False
For Jj = 1 To 2
Choose(Jj, Columns("B:L"), Columns("N:R")).Select
Selection.Sort Key1:=Choose(Jj, [B2], [N2]), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1
Next Jj
bRw = [b65500].End(xlUp).Row
For Jj = 2 To bRw
With Cells(Jj, "B")
If .Value <> .Offset(, 12).Value And .Offset(-1).Value = .Value _
And .Value <> "" Then
Set Rng = Range([N1], [N65500].End(xlUp))
Set sRng = Rng.Find(.Value, , xlFormulas, xlWhole)
If sRng Is Nothing Then
.Interior.ColorIndex = 3
Else
If sRng.Row < .Row Then
Range(.Offset(, 12), Cells(65500, "N").End(xlUp)).Resize(, 12).Cut
.Offset(1, 12).Select: ActiveSheet.Paste
.Interior.ColorIndex = 35
Else
Range(.Cells(), Cells(65500, "B").End(xlUp)).Resize(, 12).Cut
Cells(sRng.Row, "B").Select: ActiveSheet.Paste
End If
End If
End If
End With
Next Jj
End Sub