Pasi12
01-22-2014, 02:14 PM
HI ,
I am trying to find/ compare 2 columns "A" and "B" and find the match , then copy the match into a new worksheet. Would appreciate any help?
Here is what I have but only colors the cells if it finds a match I want to copy that match into new wksheet?
Thanks!
Pasi
Sub ColorDuplicates()
'Color duplicate items between columns A and B
For i = 1 To Range("E65536").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("A:A"), Range("E" & i)) = 1 Then
With Range("E" & i).Font
.ColorIndex = 5
.Bold = True
With Range("F" & i).Font
.ColorIndex = 5
.Bold = True
End With
End With
End If
Next i
For i = 1 To Range("A65536").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("E:E"), Range("A" & i)) = 1 Then
With Range("A" & i).Font
.ColorIndex = 3
.Bold = True
With Range("C" & i).Font
.ColorIndex = 3
.Bold = True
End With
End With
End If
Next i
End Sub
I am trying to find/ compare 2 columns "A" and "B" and find the match , then copy the match into a new worksheet. Would appreciate any help?
Here is what I have but only colors the cells if it finds a match I want to copy that match into new wksheet?
Thanks!
Pasi
Sub ColorDuplicates()
'Color duplicate items between columns A and B
For i = 1 To Range("E65536").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("A:A"), Range("E" & i)) = 1 Then
With Range("E" & i).Font
.ColorIndex = 5
.Bold = True
With Range("F" & i).Font
.ColorIndex = 5
.Bold = True
End With
End With
End If
Next i
For i = 1 To Range("A65536").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("E:E"), Range("A" & i)) = 1 Then
With Range("A" & i).Font
.ColorIndex = 3
.Bold = True
With Range("C" & i).Font
.ColorIndex = 3
.Bold = True
End With
End With
End If
Next i
End Sub