Results 1 to 3 of 3

Thread: Comparing Lists [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526

    Comparing Lists [RESOLVED]

    I have 56 string lists which need to be compared [2 each of 28 types]. One represents an old list and one an updated list. Each list can contain hundreds of items and I am trying to determine ONLY the values of the items in the updated list that are NOT present in the old lists.

    Each list is a column in an Excel spreadsheet. Haven't found the right Excel function to fit. Would appreciate any assistance someone might provide.
    Last edited by doofusboy; Oct 5th, 2003 at 05:27 AM.
    Do canibals not eat clowns because they taste funny?

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    There may be a complex Excelfunction that fits, but if you are only talking hundreds, this should do the trick. Assuming master list is in column A and new list is Column B, this puts "X" in Column C for each case where item in B is not in A.

    VB Code:
    1. For i = 1 To ActiveSheet.Cells.SpecialCells(xlLastCell).Row
    2.     If Columns("A:A").Find( _
    3.             What:=Range("B" & i).Value, _
    4.             After:=Range("A1"), _
    5.             LookIn:=xlValues, _
    6.             LookAt:=xlPart, _
    7.             SearchOrder:=xlByColumns, _
    8.             SearchDirection:=xlNext, _
    9.             MatchCase:=False) Is Nothing Then
    10.         Range("C" & i).Value = "X"
    11.     End If
    12. Next i

  3. #3

    Thread Starter
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526
    Hey, thanks for your reply. Looks like good code. Will try iy out. Already solved prob with a short macro that put old values in array, compared new values to array and then wrote unique values to a new list.
    Do canibals not eat clowns because they taste funny?

Posting Permissions

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



Click Here to Expand Forum to Full Width