Reputation: 1
Google sheets workbook and Apps Script- How can I add more than one Apps Script function to my workbook? I added 'AddColumn' for adding column to 1 sheet and it adds this column to all other sheets, success. I tried to add 'MainSheet' apps script but it removed/replaced the Add Columns function.
Upvotes: 0
Views: 41
Reputation: 38391
A Google Apps Script project can include as many functions as you need. You could even create additional files to help you to organize your functions, but keep in mind that the function names should be unique across all the files of the Apps Script project that contains them.
The basic steps are as follows:
Please remember that Google Apps Script uses JavaScript as a programming language. When writing functions, you should follow the JavaScript syntax rules.
Example
function addColumns(){
SpreadsheetApp.getActiveSheet().insertColumns(1);
}
function MainSheet(){
SpreadsheetApp.getSheets()[0].activate();
}
Related
Questions about multiple Apps Script projects bound to a single container
Upvotes: 0