Four formulas below. I think the issue is testing for “” in formula, but not sure.
(A) If I manually type this into k3, or paste it into any cell, it works.
=IF(G3="",-J3*D3,-100*J3*D3)
If I use these in a macro, it compiles but produces “FALSE” or errors:
(B) CF_formula = “=if(G3=”",=D3*J3,=-100*D3*J3)"
suggests change to =if(G3=",=D3*J3,=-100*D3*J3"),
note locations of dbl quotes
– if I accept the change
it results in FALSE
– if I reject the change it enters =IF(G3=",=d3*j3,=-100*d3*j3))
note that it replaces second quote above with extraneous “)”
and results in #NAME?
If I then manually correct the bolded formula immediately above to read as in (A), which works, it displays “Err:510”
(C) CF_formula = “=if(G3=0,=D3*J3,=-100*D3*J3)”
It doesn’t suggest a change and
displays Err:510. Same result if I manually correct it to (A)
(D) CF_formula = “=if(G3=Chr$(34)+Chr$(34),=D3*J3,=-100*D3*J3)”
Same behavior as (C): it doesn’t suggest a change and
displays Err:510. Same result if I manually correct it to (A)