I am trying to have all tabs in a spreadsheet renamed based on the value of a specific cell within each tab.
function onEdit() {
var sheet = SpreadsheetApp.getActiveSheet();
var oldName = sheet.getName();
var newName = sheet.getRange(1,1).getValue();
if (newName.toString().length>0 && newName !== oldName) {
sheet.setName(newName);
}
}function myFunction() {
}
This works when I edit it, but I would like it to a) just do it automatically based on a trigger setting (it updates every hour based on the cell value) AND for it to happen to ALL sheets (call them ‘1’, ‘2’, and ‘3’) within a spreadsheet based on the value of cell A1 in each sheet. The above code seems to only work on one tab and only on edit.