0
votes

I want to set the following formula(its already working fine) in first 1000 rows in excel.Actually I am looking in VBA. But, I am not familiar in VBA code.

=IFERROR(VLOOKUP(DD,HDR_COLMN,COLUMN(),0),"")

DD - getting data from another sheet

HDR_COLMN - getting table header from another sheet(Sheet2) and showing as drop down values in Sheet1

Please any one can help me. Advance thanks

1

1 Answers

1
votes

The only tricky part is the double-quotes.

Say we want to deposit this with VBA

=IFERROR(VLOOKUP(A1,B1:C10,2,TRUE),"")

This will do it:

Sub luxation()
    Range("A10").Formula = "=IFERROR(VLOOKUP(A1,B1:C10,2,TRUE),"""")"
End Sub