In Google Sheets, I would like to "Insert 1 row above/below" and have certain cells in this new row to have default values.
For example, when a new row is added, the cell in column C for this row will have the letter "N", column G will have a "Y", and column T will have a formula of "=sum(A2+B2)" - of course the A2 and B2 will need to reflect the number of this new row.
What I have so far:
function addRow() {
var sheet = SpreadsheetApp.getActiveSheet();
var cell = sheet.getActiveCell();
var range = source.getRange("'SAMPLE ROW'!A2:AJ2");
range.copyValuesToRange(0, 4, 6, 4, 6);
}
The source.getRange is grabbing data from a hidden tab I am using.
How do I use the current Row in the copyValuestoRange section?