Spreadsheets, Sheets, and Ranges
-
Access and Modify
Rename the active spreadsheet
function renameSpreadsheet() {
var mySS = SpreadsheetApp.getActiveSpreadsheet();
mySS.rename("2017 Avocado Prices in Portland, Seattle");
}Duplicate the active sheet
function duplicateAndOrganizeActiveSheet() {
var mySS = SpreadsheetApp.getActiveSpreadsheet();
var duplicateSheet = mySS.duplicateActiveSheet();
}Change the sheet's name
function duplicateAndOrganizeActiveSheet() {
var mySS = SpreadsheetApp.getActiveSpreadsheet();
var duplicateSheet = mySS.duplicateActiveSheet();
// Change the name of the new sheet.
duplicateSheet.setName("Sheet_" + duplicateSheet.getSheetId());
}Modify a sheet's columns and rows
Move ranges
Sort ranges
Last updated
Was this helpful?