Results 1 to 10 of 10

Match over 250.000 rows with a reference list

Threaded View

Anasurimbor Match over 250.000 rows with... 11-07-2018, 09:29 AM
xladept Re: Match over 250.000 rows... 11-07-2018, 12:04 PM
AlphaFrog Re: Match over 250.000 rows... 11-07-2018, 12:41 PM
Anasurimbor Re: Match over 250.000 rows... 11-07-2018, 12:50 PM
AlphaFrog Re: Match over 250.000 rows... 11-07-2018, 12:54 PM
Anasurimbor Re: Match over 250.000 rows... 11-07-2018, 12:43 PM
xladept Re: Match over 250.000 rows... 11-07-2018, 12:54 PM
xladept Re: Match over 250.000 rows... 11-07-2018, 12:47 PM
Anasurimbor Re: Match over 250.000 rows... 11-07-2018, 12:51 PM
xladept Re: Match over 250.000 rows... 11-07-2018, 01:29 PM
  1. #1
    Registered User
    Join Date
    09-03-2018
    Location
    Leipzig, Germany
    MS-Off Ver
    Excel 2016
    Posts
    8

    Match over 250.000 rows with a reference list

    Hello,

    I have the following code:

    Sub cluster_compare()
    
    Dim j As Long
    Dim maxrows As Long
    
    
    Workbooks.Open ("../Cluster.xlsx") 'I deleted a URL here that isn't relevant for my question.
    
    maxrows = IIf(IsEmpty(ThisWorkbook.Worksheets("VV").Cells(Rows.Count, 1)), ThisWorkbook.Worksheets("VV").Cells(Rows.Count, 1).End(xlUp).Row, Rows.Count)
    
    For j = 2 To maxrows
    With Workbooks("Cluster.xlsx").Worksheets("Contracts").Range("B:B")
    
    If IsEmpty(ThisWorkbook.Worksheets("VV").Cells(j, 22)) = True Then
        GoTo 1:
    Else
        Set C = .Find(ThisWorkbook.Worksheets("VV").Cells(j, 22), LookIn:=xlValues, Lookat:=xlWhole, MatchCase:=True)
        If Not C Is Nothing Then
            FirstAdress = C.Row
            Do
            ThisWorkbook.Worksheets("VV").Cells(j, 21) = Workbooks("Cluster.xlsx").Worksheets("Contracts").Cells(C.Row, 1)
    
            Set C = .FindNext(C)
            Loop While Not C Is Nothing And C.Row <> FirstAdress
        End If
        C = ""
    End If
    End With
    
    1:
    Next j
    It already does what I want. It's just incredibly slow. I have over 250.000 rows (Sheet "VV" in my base workbook) and my code takes over 2 hours to compare them to a 250 row long list (Cluster.xlsx, Sheets Contracts) of reference points. Not every row in my relevant column has a value, so I already skip empty ones.

    Is there a way to do it faster?
    Last edited by Anasurimbor; 11-07-2018 at 12:52 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Index-Match, Reference Range Jumps 8 Rows if Dragged Down
    By uckycool in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-05-2018, 10:04 PM
  2. [SOLVED] Copying a Formula over multiple rows without changing the INDEX MATCH cell reference.
    By nathandavies9 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-16-2017, 07:57 AM
  3. Replies: 9
    Last Post: 03-10-2017, 11:41 AM
  4. Trying to filter rows in an array using a list as reference
    By trajayee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2016, 06:42 PM
  5. [SOLVED] Formula to reference a list skipping 4 rows when dragged down
    By jstk886 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-10-2015, 07:55 PM
  6. INDEX MATCH with Rows and Columns as reference
    By Locust in forum Excel General
    Replies: 4
    Last Post: 06-11-2014, 02:35 PM
  7. [SOLVED] Postcode Match: Cross Reference from another list
    By denise001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2013, 06:22 AM

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