IF formula syntax problem
I think you may need to refer to cell C2 in R1C1 reference style, i.e.:
Range("D2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=""Y"",1,0)"
"Stephen" wrote in message
...
Hi folks,
I'm trying to get my code to insert an IF formula into a cell...
Range("D2").Select
ActiveCell.Formula = "=IF(C2='Y',1,0)"
but I keep getting an object-defined error. I've tried variations of
quotes
and parens. but the best I am able to come up with is having it populate
the
formula as a string. What am I missing?
Thanks.
|