I work with excel 365 online. I am trying to duplicate a certain number of times a template sheet that I then have to rename by the value of a cell.
I have tried and tested several codes but currently, it returns an error on the loop and I have a problem renaming the created copy (which I think is linked to the fact that I do not activate the right tab). I am having trouble finding documentation on excel scripts so I am a little lost.
A little help would be appreciated!
function main(workbook: ExcelScript.Workbook) {
let modele = workbook.getWorksheet("Semaine 36");
for (i = 1 to 5 );
// Duplicate worksheet
let modele_copie = modele.copy(ExcelScript.WorksheetPositionType.after, modele);
let sheet = workbook.getActiveWorksheet();
const cellule = sheet.getRange('A3');
const valeur = cellule.getValue();
sheet.setName(valeur)
next i;
}
