![]() 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 Var newtemplate = SpreadsheetApp.openById(newsheet) 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() Right click the button, click the edit icon and enter the name of the new function under the "Assign Script option.The examples on this page illustrate how you can achieve some common Sheets operations with the Sheets API. ![]() The Google Sheets API lets you create, clear, copy, and delete sheets, and also control their properties. Copy a sheet from one spreadsheet to another. Close the editor using the Browser "close" button Clear a sheet of all values while preserving formats.You can rename the function is you wish.Copy the script below, and paste it into "Code" tab (you can delete the "myFunction()" function). There should be two tabs: "Code" and "macros".Copy the script to the Script Editor (Tools > Script Editor).You will need to substitute the macro for a script like the one below. Macros have their strengths and weaknesses but in this case, a macro can't manage the steps required to delete the button on the new spreadsheet. A macro is a Google Apps Script that is automatically created by user UI interactions. You are using a macro to copy the spreadsheet. You want to copy a spreadsheet template by clicking a button, and then delete the button in the newly copied spreadsheet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |