I have this code that works well. The loop copy the formula over the cells i need.
for(i=0;i<52;i++){
activeSheet.getRange(124,2+i).setValue(text2);
activeSheet.getRange(125,2+i).setFormula("=SUMIF($A$1:$A$40;\""+text+"\";B1:B40)*B124"); }
However I need the formula to increment during the loop. As exemple I need the loop to write this :
cell 1: =SUMIF($A$1:$A$40;\""+text+"\";B1:B40)*B124
cell 2: =SUMIF($A$1:$A$40;\""+text+"\";C1:C40)*B124
cell 3: =SUMIF($A$1:$A$40;\""+text+"\";D1:D40)*B124
Can someone help with this ?