Finding differences in two columns

sboutte42178

New Member
Joined
Sep 10, 2010
Messages
15
I have two columns, one (Column A) with a list submitted last week, and another (Column B) from this week. I need to see if i can sort out only new items in list B. That way each week, I'm submitting new items weekly. These are all dumps from access, so i might have to do this there.

Any suggestions?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
If you are using excel 2007 or later:

In C2 and copy down:

Code:
=IFERROR(VLOOKUP(B2,$A$2:$A$500,1,0),"")

In older versions of excel:

Code:
=IF(ISERROR(VLOOKUP(B2,$A$2:$A$500,1,0),"",VLOOKUP(B2,$A$2:$A$500,1,0))
 
Upvote 0
If by code, maybe:
Rich (BB code):
Option Explicit
    
Sub exa()
Dim DIC1 As Object
Dim DIC2 As Object
Dim Vals1 As Variant
Dim Vals2 As Variant
Dim Val As Variant
Dim wks As Worksheet
    
    Set DIC1 = CreateObject("Scripting.Dictionary")
    Set DIC2 = CreateObject("Scripting.Dictionary")
    '// Chnage worksheet name to suit                                   //
    Set wks = ThisWorkbook.Worksheets("Sheet1")
    
    With wks
        '// Change start row to 2 if header                             //
        Vals1 = Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp)).Value
        Vals2 = Range(.Cells(1, 2), .Cells(.Rows.Count, 2).End(xlUp)).Value
        
        For Each Val In Vals1
            DIC1.Item(Val) = Empty
        Next
        
        For Each Val In Vals2
            If Not DIC1.Exists(Val) Then DIC2.Item(Val) = Empty
        Next
        '// Plunk wherever                                                  //
        .Range("D1").Resize(DIC2.Count, 1).Value = Application.Transpose(DIC2.Keys)
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top