How to write a worksheet function in vba

Andries

Board Regular
Joined
Feb 3, 2011
Messages
127
Hi there

How do I write this worksheet function in vba code?

IFERROR(IF(AND($B$47=data2!$H$1,data2!$I$1=1)*TRUE,VLOOKUP($A49,data2!$A$2:$O$4000,2,0),""),"NR")

Thank you
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Hi. Try like this

Code:
ActiveCell.Formula = "IFERROR(IF(AND($B$47=data2!$H$1,data2!$I$1=1)*TRUE,VLOOKUP($A49,data2!$A$2:$O$4000,2,0),""""),""NR"")"
 

Watch MrExcel Video

Forum statistics

Threads
1,108,809
Messages
5,525,002
Members
409,615
Latest member
papaluigi94

This Week's Hot Topics

Top