A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/reference/spreadsheet/named-range below:

Class NamedRange | Apps Script

Class NamedRange

Stay organized with collections Save and categorize content based on your preferences.

NamedRange

Create, access and modify named ranges in a spreadsheet. Named ranges are ranges that have associated string aliases. They can be viewed and edited via the Sheets UI under the Data > Named ranges... menu.

Detailed documentation getName()

Gets the name of this named range.

Return

String — the name of this named range

Scripts that use this method require authorization with one or more of the following scopes:

getRange()

Gets the range referenced by this named range.

Return

Range — the spreadsheet range that is associated with this named range

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

remove()

Deletes this named range.

// The code below deletes all the named ranges in the spreadsheet.
const namedRanges = SpreadsheetApp.getActive().getNamedRanges();
for (let i = 0; i < namedRanges.length; i++) {
  namedRanges[i].remove();
}
Authorization

Scripts that use this method require authorization with one or more of the following scopes:

setName(name)

Sets/updates the name of the named range.

// The code below updates the name for the first named range.
const namedRanges = SpreadsheetApp.getActiveSpreadsheet().getNamedRanges();
if (namedRanges.length > 1) {
  namedRanges[0].setName('UpdatedNamedRange');
}
Parameters Name Type Description name String The new name of the named range. Return

NamedRange — the range whose name was set by the call

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

setRange(range)

Sets/updates the range for this named range.

Parameters Name Type Description range Range The spreadsheet range to associate with this named range. Return

NamedRange — the named range for which the spreadsheet range was set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-12-02 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["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"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4