I'm trying to insert a formula into a cell using VBA.
This one code works just fine:
Range("C6").FormulaLocal = "=SI(AI6<>"""";""Dictaminado"";SI(O(AB6<>"""";AC6<>"""");""En Dictamen"";SI(AA6<>"""";""Recibido"";""Pend. Pack"")))"
The problem is with this other code:
Range("D6").FormulaLocal = "=SI(O(E6:I6="""";K6="""";N6:O6="""";Q6:S6="""";Y6="""";AA6:AC6="""";AE6:AF6="""";AH6:AK6="""");""Miss. Info"";""Complete"")"
In Excel an @
appears in front of every range in the formula like this:
=SI(O(E6="";K6="";@N6:O6="";@Q6:S6="";Y6="";@AA6:AC6="";@AE6:AF6="";@AH6:AK6="");"Miss. Info";"Complete")
And it throws a #VALUE
error. Can someone explain why is this happening and how to avoid it?