Hi Pankaj jaswani,
Please try:
1. For dynamic array
Sub Vlookuparray_Dynamic()
Dim LastRow As Long
With Sheets("Data")
LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("U2:U" & LastRow).Formula2 = "=VLOOKUP(R2,Mapping!A:AB,{13,15,21,25},FALSE)"
End With
End Sub
2. For non-dynamic array
Sub Vlookuparray()
Dim LastRow As Long
With Sheets("Data")
LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("U2").Resize(1, 4).FormulaArray = "=VLOOKUP(R2,Mapping!A:AB,{13,15,21,25},FALSE)"
.Range("U2").Resize(1, 4).Select
Selection.AutoFill Destination:=Range("U2:X" & LastRow), Type:=xlFillDefault
End With
End Sub
Bookmarks