Hi, I am using VBA to insert a formula in a cell, I want the formula in I6 is
if(G6="a",vlookup($b6,sheet1!$d$6:$i$344,6,false),"")
my VBA is
Worksheets("data").Range("I6").Formula = "=if(G6="a",vlookup($b6,sheet1!$d$6:$I$344,6,false),"")"
but when i run it, when come to G6="a", the message is "expected end of statement".
how can i solve this problem?
Thanks!
Linda