Respected All,
I want help With mentioned Vba Vlookup code Which i already got from this forum with little change that vllokup renturn value from Last match is this possible??
Also attached sample file & Link from where i found this code......
Please Help...
http://forum.chandoo.org/threads/faster-way-to-vlookup-in-vba.19029/
I want help With mentioned Vba Vlookup code Which i already got from this forum with little change that vllokup renturn value from Last match is this possible??
Also attached sample file & Link from where i found this code......
Please Help...
http://forum.chandoo.org/threads/faster-way-to-vlookup-in-vba.19029/
Code:
Sub LookmeUp()
Dim i As Integer
Dim j As Integer
Dim lr As Long
Dim var As Variant
Dim ar As Variant
Dim t As Double
t = Timer
lr = Sheet2.Range("A" & Rows.Count).End(xlUp).Row
ReDim var(1 To lr, 1 To 9) 'Change 9 to suit
ReDim ar(1 To 9, 1 To 1) 'Change 9 to suit
For j = 1 To UBound(ar) 'Trap the position of the column
ar(j, 1) = Sheet1.Rows(1).Find(Sheet3.Range("A" & j + 1), , , xlWhole).Column
Next j
For i = 2 To lr 'Trap the values of the Vlookup
For j = 1 To UBound(ar)
var(i - 1, j) = Application.VLookup(Cells(i, 1), Sheet1.[A:J], ar(j, 1), 0)
Next j
Next i
Sheet2.Range("B2:J" & lr) = var
MsgBox Timer - t
End Sub