// The code below deletes all the named ranges in the spreadsheet.constnamedRanges=SpreadsheetApp.getActive().getNamedRanges();for(leti=0;i < namedRanges.length;i++){namedRanges[i].remove();}
// The code below updates the name for the first named range.constnamedRanges=SpreadsheetApp.getActiveSpreadsheet().getNamedRanges();if(namedRanges.length > 1){namedRanges[0].setName('UpdatedNamedRange');}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-22。"],[[["Named ranges provide string aliases for cell ranges within a spreadsheet, enhancing readability and simplifying formulas."],["You can manage named ranges through the Sheets UI under \"Data \u003e Named ranges...\" or programmatically using Apps Script methods."],["Apps Script offers methods to create, access, modify, and delete named ranges, including `getName()`, `getRange()`, `remove()`, `setName()`, and `setRange()`."],["These methods enable you to retrieve and update the name and range associated with a named range, as well as delete it entirely."],["Authorization is required to utilize these methods, necessitating specific scopes like `https://www.googleapis.com/auth/spreadsheets`."]]],["Named ranges in spreadsheets can be managed using provided methods. You can retrieve a named range's name using `getName()`, or its associated range using `getRange()`. To modify, use `setName(name)` to change the named range's alias and `setRange(range)` to assign it a new range. To delete the range use `remove()`. These actions require spreadsheet authorization scopes. The UI location is in **Data \u003e Named ranges...** menu.\n"]]