Hello,
I created vlookup + iferror code but I am getting the error 1004 and I am stuck.
The principle is to do a vlookup in sheet("ana").Range("AG2:AG) (being Cells(i,30)) from other sheet Range(D:D )
Can you please help ?
Code
Sub ana()
Dim lkupval As String
Dim lkparr As Range
Dim i As Long
Dim lkprez As Long
Set lkparr = Sheets("Business").Range("D1:D500000")
Sheets("2nd sheet").Activate
For i = 2 To Range("D2").End(xlDown).Row
Set lkpval = Cells(i, 1)
lkprez = Application.VLookup(lkpval, lkparr, 1, False)
If Not IsError(lkprez) Then
Cells(i, 30) = lkprez
Else
Cells(i, 30) = "#"
End If
Next i
End Sub
Display More