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

  • Thread starter Thread starter elaine
  • Start date Start date
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.
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top