![]() drawing.remove() - deletes the first drawing from the spreadsheet.var drawing = newtemplatesheet.getDrawings() - gets all the drawings on the first sheet.var newtemplatesheet = newtemplate.getSheets() - gets the first (and only) sheet from the newly created spreadsheet.var newtemplate = SpreadsheetApp.openById(newsheet) - opens the newly created spreadsheet for editing by using openById(id).var newsheet = ss.copy('Deal Analyser - ').getId() - a variable is assigned to the result and getid() gets the unique identifier for the newly creatred spreadsheet.Logger.log("DEBUG: the number of drawings is "+drawing.length) Var drawing = newtemplatesheet.getDrawings() Var newtemplatesheet = newtemplate.getSheets() get the first sheet in the copy of the template It runs automatically on every edit, and renames the active sheet if the content of A1 (referred by row 1, column 1) does not match the current sheet name. Var newtemplate = SpreadsheetApp.openById(newsheet) Here's a script that does this: enter it in Tools > Script Editor. Logger.log("DEBUG: the ID of the new spreadsheet = "+newsheet) Var newsheet = ss.copy('Deal Analyser - ').getId() copy the spreadsheet and return the ID of the new spreadsheet Var ss = SpreadsheetApp.getActiveSpreadsheet() ![]()
0 Comments
Leave a Reply. |