View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default What's wrong with this code (r1c1 paste)

You are using A1 notation and FormulaR1C1, try

ActiveCell.Formula = _
"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(2004 &N$5))),(VALUE(YEAR($J6)&M
ONTH($J6))=VALUE(2004&N$5))),1,0)"


--

HTH

RP

"mmattson" wrote in message
...
ActiveCell.FormulaR1C1 =

"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(2004 &N$5))),(VALUE(YEAR($J6)&M
ONTH($J6))=VALUE(2004&N$5))),1,0)"