View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rick Rick is offline
external usenet poster
 
Posts: 334
Default If function in Macro

Hi,

This is the if statement in Excel,

=IF(NOW()+7H5,$J5,"").

This is how I have it in the macro,

Range("R5").Select
ActiveCell.FormulaR1C1 = "=if(now()+7RC[-10],$RC[-8],"")"

But I get and object defined error.

Is my problem with R1C1 reference style or something else?

Thanks
rick
When I run the macro I get