I am trying to speed up this macro. You can see lots of data is sifted through. Basically, the macro will go through a column of data (ce) (quite large) and for each row will find a string match based on another column in another worksheet (NAME2). Once a match is found the value found is inserted a few few rows over from the (ce) at hand This macro works great as is. However, I'm beginning to deal with huge amounts of data and need a much faster process. I have played around with Exit For but get errors related to "no For in Next". I believe much time is wasted sifting through all i values (0 To 30000+) when an early exit might be ideal once a match is found. Thanks. Here is the code below:
![]()
Sub crosscheck() Dim nombre As Range Set nombre = Sheets("NAME2").Range("A2:A31335") For Each ce In Range("A1:A101218") 'Nombre For i = 0 To 31334 If InStr(1, LCase(ce), LCase(nombre(i))) > 0 Then ce.Offset(0, 3).Value = nombre(i, 2) Next i Next ce End Sub
Bookmarks