compare 2 lists and common ones display on the 3rd column

E

elaine

Hi,

Is there a way to compare data in 2 columns, and display the same ones
that occur in both lists to a 3rd column?

Thanks.
Elaine.
 
S

somethinglikeant

Use a macro:-


Sub CompareAndPutinColumn3()
j = 1
For i = 1 To Application.WorksheetFunction.CountA(Columns(1))
If Application.WorksheetFunction.CountIf(Columns(2), Cells(i, 1)) >
0 Then
Cells(j, 3) = Cells(i, 1)
j = j + 1
End If
Next i
End Sub

somethinglikeant
 
E

elaine

thanks!!!

Use a macro:-


Sub CompareAndPutinColumn3()
j = 1
For i = 1 To Application.WorksheetFunction.CountA(Columns(1))
If Application.WorksheetFunction.CountIf(Columns(2), Cells(i, 1)) >
0 Then
Cells(j, 3) = Cells(i, 1)
j = j + 1
End If
Next i
End Sub

somethinglikeant
 
E

elaine

thanks!!!

Use a macro:-


Sub CompareAndPutinColumn3()
j = 1
For i = 1 To Application.WorksheetFunction.CountA(Columns(1))
If Application.WorksheetFunction.CountIf(Columns(2), Cells(i, 1)) >
0 Then
Cells(j, 3) = Cells(i, 1)
j = j + 1
End If
Next i
End Sub

somethinglikeant
 
Top