• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extract NEW records

Portucale

Member
Hi,

Have a report which everyday extracts data from a database, the data extracted is always from Jun 26th, I need to identify any new records from the previous day, example below:

Yesterday

Today

10

10

11

11

12

12

13

13

14

14

15

15


16


17


In my list I need to see 16 & 17 only.

Any help and all help is very much appreciated,

Thanks in advance
 
With what is visible here (on this forum), how do we know that 16 and 17 are special?
 
Ops, so sorry, can't even help myself,

Yesterday Today New Records
10 10 16
11 11 17
12 12
13 13
14 14
15 15
16
17

Thanks for the help,
 

Attachments

  • Extract NEW records.xls
    25 KB · Views: 5
Ah, that helps! :)
Put this array formula in C2, copy down as far as ever needed.
=IF(COUNT(B:B)-COUNT(A:A)<ROWS(C$2:C2),"",INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$100,A$2:A$100,0)),ROW(A$2:A$100)),ROWS(C$2:C2))))
Array formulas are confirmed with Ctrl+Shift+Enter, not just Enter.
 
Hi @Portucale

Here is a VBA procedure to do what you want.

Code:
Option Explicit
 
Sub Compare1()
Dim ar As Variant
Dim var()
Dim i As Long
Dim n As Long
 
ar = Range("a9").CurrentRegion 'Change input to suit
 
ReDim var(1 To UBound(ar, 1), 1 To 1)
 
    With CreateObject("scripting.dictionary")
        .comparemode = 1
        For i = 1 To UBound(ar, 1)
            .Item(ar(i, 2)) = Empty
        Next
        For i = 1 To UBound(ar, 1)
            If Not .exists(ar(i, 1)) Then
                n = n + 1
                var(n, 1) = ar(i, 1)
            End If
        Next
    End With
[D9].Resize(n).Value = var 'Change output to suit
 
End Sub

Link to file which shows workings.

Compare

Take care

Smallman
 
Back
Top