NemanjaAndic
New Member
- Joined
- Jan 5, 2015
- Messages
- 3
Hi people! I am trying to make vlookup faster, but it isn't going as expected.
The problem is maybe that there are 400k records in base sheet and 20k in final sheet. Is there any faster way, maybe not vlookup, maybe not even vba, to get this done faster? Thanks in advance.
Here is my code:
The problem is maybe that there are 400k records in base sheet and 20k in final sheet. Is there any faster way, maybe not vlookup, maybe not even vba, to get this done faster? Thanks in advance.
Here is my code:
Code:
Sub Vlookup400k()
Dim lr As Long
Application.ScreenUpdating = False
Calculation = xlCalculationManual
DisplayPageBreaks = False
EnableEvents = False
lr = Range("A" & Rows.Count).End(xlUp).Row
Range("C2:C" & lr).FormulaR1C1 = "=VLOOKUP(RC[-1],DB!C[-2]:C[-1],2,0)"
Range("C2:C" & lr).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
Calculation = xlCalculationAutomatic
EnableEvents = True
End Sub
Last edited by a moderator: