+ Reply to Thread
Results 1 to 4 of 4

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

Hybrid View

Guest compare 2 lists and common... 07-05-2006, 01:30 PM
Guest Re: compare 2 lists and... 07-05-2006, 01:40 PM
Guest Re: compare 2 lists and... 07-11-2006, 01:35 PM
Guest Re: compare 2 lists and... 07-11-2006, 01:35 PM
  1. #1
    elaine
    Guest

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

    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.


  2. #2
    somethinglikeant
    Guest

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

    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

    elaine wrote:

    > 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.



  3. #3
    elaine
    Guest

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

    thanks!!!


    somethinglikeant wrote:
    > 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
    >
    > elaine wrote:
    >
    > > 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.



  4. #4
    elaine
    Guest

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

    thanks!!!


    somethinglikeant wrote:
    > 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
    >
    > elaine wrote:
    >
    > > 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.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1