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

All sequences not found in batch to be placed in separate worksheet

shili12

Member
A follow up from this thread, All sequences required from this range
let me define my problem objectively :-
I have 2 worksheets, fleet and non fleet, all with certificates in unique sequence,
non fleetfleet
PeriodCertificateCertificate
C24185668B11816877
C24185651B11816631
C24185667B11822719
C24724059B11822720
C24724058B11821813
C24724065B11817175
C24724187B11821820
C24185660B11816874
C24724060B11826164
C24724167B11816878
C24724061B11826610
C247241710
C24724177B11844710
B11829889
etc etc 230000 lines0

the table/range I have from issuer of certificates is in a batch mode. see below
The goal: Find out which certificates in batch mode are not issued in unique sequence ( above) and place in it separate worksheet.

As i use excel 365, any method is acceptable , VBA, formulae, LET, lambda,
#Transaction DateCompany NameCertificate TypeFirst Serial #Last Serial #Qty(Out/In)User NameAvailable Balance
22564​
21/06/2022 12:12​
Acme Insurance Company Ltd.Type B - Commercial VehicleB12316070B12316099
30​
Hemstone
34​
22594​
21/06/2022 14:22​
Acme Insurance Company Ltd.Type B - Commercial VehicleB12337528B12338527
1000​
Kimanzi
1005​
22652​
21/06/2022 16:28​
Acme Insurance Company Ltd.Type B - Commercial VehicleB12336312B12336321
10​
Mary
600​
51092​
12/05/2022 11:56​
Acme Insurance Company Ltd.Type C - Private CarC22568962C23249190
25​
Faith
3751​
51097​
12/05/2022 11:57​
Acme Insurance Company Ltd.Type C - Private CarC23500530C23500539
10​
Faith
3777​
51098​
12/05/2022 11:58​
Acme Insurance Company Ltd.Type C - Private CarC25380547C25380556
10​
Faith
3787​
3442​
09/06/2022 11:19​
Acme Insurance Company Ltd.Type D - PSVD4586425D4586446
-22​
Blanche
369​
3443​
09/06/2022 11:26​
Acme Insurance Company Ltd.Type D - PSVD4586468D4586471
-25​
Blanche
344​
3652​
24/06/2022 14:23​
Acme Insurance Company Ltd.Type D - PSVD4551255D4551258
-4​
Blanche
450​
 

Attachments

  • nonfleetAKIfleet20221.xlsb
    64.9 KB · Views: 11
Last edited:
According to your attachment a starter VBA demonstration to paste only to the Result worksheet module :​
Code:
Sub Demo2()
        UsedRange.Offset(1).Clear
        Application.ScreenUpdating = False
    With CreateObject("Scripting.Dictionary")
        For Each V In [nonfleetcompany!A1].CurrentRegion.Columns(27).Value2:  .Item(V) = Empty:  Next
        For Each V In [fleetcompany!A1].CurrentRegion.Columns(27).Value2:     .Item(V) = Empty:  Next
        W = [Fromissuer!A1].CurrentRegion.Columns("E:F")
    For R& = 2 To UBound(W)
            P& = Mid(W(R, 1), 2) - 1
            N& = Mid(W(R, 2), 2) - P
            ReDim T$(1 To N, 0)
        For Each V In Evaluate("""" & Left(W(R, 1), 1) & """&ROW(1:" & N & ")+" & P)
            If Not .Exists(V) Then L& = L& + 1: T(L, 0) = V
        Next
            If L Then Cells(Rows.Count, 1).End(xlUp)(2).Resize(L) = T: L = 0
    Next
       .RemoveAll
    End With
        Application.ScreenUpdating = True
End Sub
 
Thank you. If it works well given that it can fit within the excel column which it's most likely to do so, it will help me in detection of fraudulent activities.
 
Back
Top