View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ALEX ALEX is offline
external usenet poster
 
Posts: 493
Default copying by formula....

Sorry I found it!!

In fact there is a bug in excel because we have to write the formula with
"," and not with ";"

exemple:

Wrong:
TargetWorkSheet.Cells(RowWhereToWrite, ColumnWhereToWrite).FormulaR1C1
=IF(AND((int(RC[-5])-int(RC[-2]))<0;INT(RC[-6])<
1;INT(RC[-1])=0;INT(RC[-2])=0),RC[-5]/(RC[-5]-RC[-2])*100,"-")

Right:
TargetWorkSheet.Cells(RowWhereToWrite, ColumnWhereToWrite).FormulaR1C1
=IF(AND((int(RC[-5])-int(RC[-2]))<0,INT(RC[-6])<
1,INT(RC[-1])=0,INT(RC[-2])=0),RC[-5]/(RC[-5]-RC[-2])*100,"-")





"Alex" wrote:

Hello

I use the result of several column to compute a value in another column with
some conditions but it doesn't work. The fomula seems to be wrong but I don't
know where.

TargetWorkSheet.Cells(RowWhereToWrite, ColumnWhereToWrite).FormulaR1C1
=IF(AND((int(RC[-5])-int(RC[-2]))<0;INT(RC[-6])<
1;INT(RC[-1])=0;INT(RC[-2])=0),RC[-5]/(RC[-5]-RC[-2])*100,"-")

Thank you