1function onOpen() {
2 var activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
3 var yourNewSheet = activeSpreadsheet.getSheetByName("Name of your new sheet");
4
5 if (yourNewSheet != null) {
6 activeSpreadsheet.deleteSheet(yourNewSheet);
7 }
8
9 yourNewSheet = activeSpreadsheet.insertSheet();
10 yourNewSheet.setName("Name of your new sheet");
11}
12