I understand what those 2 variables would be. If the source row is by default in 2, I would only have to change the name of the sheet.

But the sequence of this example doesn’t match the script below, I don’t see an option in this script to rename the sheet.

```
function copyFormulasDown(sheet, sourceRow) {
if (sourceRow === undefined) {
sourceRow = 2;
}
var formulas = getFormulas_(sheet, sourceRow);
if (formulas !== {}) {
var rows = sheet.getDataRange().getFormulas();
for (var r = rows.length - 1; r >= sourceRow && rows[r].join('') === ''; r--) {
copyFormulas_(sheet, r, formulas);
}
}
}
```

Could you help me to know in this same example where I should change the name of the sheet?

Note: I leave the complete example below. I took it from an example you gave.

```
/**
* Copy Formulas Down
* This script copies functions from a source row (usually the first data row in a spreadsheet) to
* rows at the end of the sheet, where the colums for these formulas are still empty.
* It checks row from the bottom upwards, copying formulas into the rows where there are no formulas yet,
* and stops as soon as it finds a row which has a formula already.
* When copying formulas, it leaves values in other cells unchanged.
*/
/**
* Copy formulas from the a source row in a sheet to rows below
* @param {Sheet} sheet Google Spreadsheet sheet
* @param {int} sourceRow (optional) 1-based index of source row from which formulas are copied, default: 2
*/
function copyFormulasDown(sheet, sourceRow) {
if (sourceRow === undefined) {
sourceRow = 2;
}
var formulas = getFormulas_(sheet, sourceRow);
if (formulas !== {}) {
var rows = sheet.getDataRange().getFormulas();
for (var r = rows.length - 1; r >= sourceRow && rows[r].join('') === ''; r--) {
copyFormulas_(sheet, r, formulas);
}
}
}
/**
* Copy formulas into row r in sheet
* @param {Sheet} sheet Google Spreadsheet sheet
* @param {int} r 1-based index of row where formulas will be copied
* @param {array} formulas array of objects with column index and formula string
*/
function copyFormulas_(sheet, r, formulas) {
for (var i = 0; i < formulas.length; i++) {
sheet.getRange(r + 1, formulas[i].c + 1).setFormulaR1C1(formulas[i].formula);
}
}
/**
* Read formulas from the source row, creating an array of objects
* Each objects contains the column index and formula string
* @param {Sheet} sheet Google Spreadsheet sheet
* @param {int} r 1-based index of source row
* @return {array} array of objects
*/
function getFormulas_(sheet, r) {
var row = sheet.getRange(r, 1, 1, sheet.getLastColumn()).getFormulasR1C1()[0];
var formulas = [];
for (var c = 0; c < row.length; c++) {
if (row[c] !== '') {
formulas.push({
c: c,
formula: row[c]
});
}
}
return formulas;
}
```

@Darren_Murphy help me