Hi everyone was wondering how do i insert a formula into the newly created row this script inserts 10 new row and i would like to instert a formula in the 10 new created row in the column E
var ss = SpreadsheetApp.getActive();
var target = ss.getSheetByName('Data Entry');
target.insertRowsAfter(target.getMaxRows(), 10)
what would i need to insert this formula in those newly created rows
=If(len(D3:D),vlookup(D3:D,'Configuration List'!A2:B,2,0),"")
You want to add rows to the last row, and put the formulas to column E in the created rows. You want to modify "D3:D" of the formulas. If my understanding is correct, how about these 2 solutions? I think that there are several solutions for your situation. So please think of this as two of them.
Pattern 1 :
In this script, it creates 2 dimensional array including the formulas. And put them to column E of the created rows using
setFormulas()
.Pattern 2 :
In this script, it creates a formula. And put it to column E of the created rows using
setFormula()
.Note :
References :
If I misunderstand your question, please tell me. I would like to modify it.