Public Sub ProcessData()
Dim LastrowA As Long
Dim LastrowJ As Long
Dim Nextrow As Long
Dim i As Long, j As Long
Dim FirstCell As String
Dim Matched As Boolean
Dim cell As Range
Application.ScreenUpdating = False
With ActiveSheet
LastrowA = .Cells(.Rows.Count, "A").End(xlUp).Row
LastrowJ = .Cells(.Rows.Count, "J").End(xlUp).Row
For i = 2 To LastrowJ
Set cell = Nothing
Matched = False
Set cell = .Columns("A").Find(.Cells(i, "J").Value2)
Nextrow = 1
Matched = False
If Not cell Is Nothing Then
FirstCell = cell.Address
Do
Matched = (.Cells(cell.Row, "B").Value2 = .Cells(i, "K").Value2) And _
(LCase(.Cells(cell.Row, "C").Value2) = LCase(.Cells(i, "L").Value2)) And _
(.Cells(cell.Row, "D").Value2 = .Cells(i, "M").Value2) And _
(.Cells(cell.Row, "E").Value2 = .Cells(i, "N").Value2) And _
(.Cells(cell.Row, "F").Value2 = .Cells(i, "O").Value2)
Set cell = .Columns("A").FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstCell
End If
If Matched Then
Nextrow = Nextrow + 1
.Cells(i, "J").Resize(, 6).Copy .Cells(Nextrow, "R")
Else
.Cells(i, "J").Resize(, 6).Interior.ColorIndex = 15 'Copy .Cells(Nextrow, "R")
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
Bookmarks