View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stephen Stephen is offline
external usenet poster
 
Posts: 26
Default IF formula syntax problem

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.