Make this range the active range.
Break any multi-column cells in the range into individual cells again.
Break any multi-column cells in the range into individual cells again. Calling this function on a range is equivalent to selecting a range and clicking Format -> Merge -> Unmerge.
Determines whether the user has permission to edit every cell in the range.
Determines whether the user has permission to edit every cell in the range. The spreadsheet owner is always able to edit protected ranges and sheets.
Clears the range of contents, format, data-validation rules, and/or comments, as specified with the given advanced options.
Clears the range of contents, format, data-validation rules, and/or comments, as specified with the given advanced options. By default all data will be cleared.
Clears the range of contents, formats, and data-validation rules.
Clears the content of the range, leaving the formatting intact.
Clears the data-validation rules for the range.
Clears formatting for this range.
Clears formatting for this range. This clears text formatting for the cell or cells in the range, but does not reset any number formatting rules.
Clears the note in the given cell or cells.
Copy the formatting of the range to the given location.
Copy the formatting of the range to the given location. If the destination is larger or smaller than the source range then the source will be repeated or truncated accordingly. Note that this method copies the formatting only.
Copy the formatting of the range to the given location.
Copy the formatting of the range to the given location. If the destination is larger or smaller than the source range then the source will be repeated or truncated accordingly. Note that this method copies the formatting only. For a detailed description of the gridId parameter, see getGridId().
Copies the data from a range of cells to another range of cells.
Copies the data from a range of cells to another range of cells. By default both the values and formatting are copied, but this can be overridden using advanced arguments.
Copies the data from a range of cells to another range of cells.
Copies the data from a range of cells to another range of cells. Both the values and formatting are copied.
Copy the content of the range to the given location.
Copy the content of the range to the given location. If the destination is larger or smaller than the source range then the source will be repeated or truncated accordingly.
Copy the content of the range to the given location.
Copy the content of the range to the given location. If the destination is larger or smaller than the source range then the source will be repeated or truncated accordingly. For a detailed description of the gridId parameter, see getGridId().
Returns a string description of the range, in A1 notation.
Returns the background color of the top-left cell in the range (i.e., '#ffffff').
Returns the background colors of the cells in the range (i.e., '#ffffff').
Returns a given cell within a range.
Returns the starting column position for this range.
Returns a URL for the data in this range, which can be used to create charts and queries.
Return the data inside this Range as a DataTable.
Return the data inside this object as a DataTable.
Returns the data-validation rule for the top-left cell in the range.
Returns the data-validation rule for the top-left cell in the range. If data validation has not been set on the cell, this method returns null.
Returns the data-validation rules for all cells in the range.
Returns the data-validation rules for all cells in the range. If data validation has not been set on a given cell, this method returns null for that cell's position in the array.
Returns the font color of the cell in the top-left corner of the range, in CSS notation (like '#ffffff' or 'white').
Returns the font colors of the cells in the range in CSS notation (like '#ffffff' or 'white').
Returns the font families of the cells in the range.
Returns the font family of the cell in the top-left corner of the range.
Gets the line style of the cell in the top-left corner of the range ('underline', 'line-through', or 'none').
Gets the line style of the cells in the range ('underline', 'line-through', or 'none').
Returns the font size in point size of the cell in the top-left corner of the range.
Returns the font sizes of the cells in the range.
Returns the font style ('italic' or 'normal' of the cell in the top-left corner of the range.
Returns the font styles of the cells in the range.
Returns the font weight (normal/bold) of the cell in the top-left corner of the range.
Returns the font weights of the cells in the range.
Returns the formula (A1 notation) for the top-left cell of the range, or an empty string if the cell is empty or doesn't contain a formula.
Returns the formula (R1C1 notation) for a given cell, or null if none.
Returns the formulas (A1 notation) for the cells in the range.
Returns the formulas (A1 notation) for the cells in the range. Entries in the 2D array will be an empty string for cells with no formula.
Returns the formulas (R1C1 notation) for the cells in the range.
Returns the formulas (R1C1 notation) for the cells in the range. Entries in the 2D array will be null for cells with no formula.
Returns the grid ID of the range's parent sheet.
Returns the grid ID of the range's parent sheet. The first sheet created in a spreadsheet has a grid ID of 0, and each sheet created thereafter increments the ID. The ID does not necessarily correspond to a sheet's tab position because sheets may have been reordered or deleted. If a sheet is deleted, the grid ID for subsequent sheets continues to increment, and the grid ID of the deleted sheet is not reused.
Returns the height of the range.
Returns the horizontal alignment of the text (left/center/right) of the cell in the top-left corner of the range.
Returns the horizontal alignments of the cells in the range.
Returns the end column position.
Returns the end row position.
Returns the note associated with the given range.
Returns the notes associated with the cells in the range.
Returns the number of columns in this range.
Returns the number of rows in this range.
Get the number formatting of the top-left cell of the given range.
Get the number formatting of the top-left cell of the given range. The number format corresponds to a formatting created when a user clicks Format -> Number.
Returns the number formats for the cells in the range.
Returns the row position for this range.
Returns the row position for this range.
Returns the sheet this range belongs to.
Returns the value of the top-left cell in the range.
Returns the value of the top-left cell in the range. The value may be of type Number, Boolean, Date, or String depending on the value of the cell. Empty cells will return an empty string.
Returns the rectangular grid of values for this range.
Returns the rectangular grid of values for this range. Returns a two-dimensional array of values, indexed by row, then by column. The values may be of type Number, Boolean, Date, or String, depending on the value of the cell. Empty cells will be represented by an empty string in the array. Remember that while a range index starts at 1, 1, the JavaScript array will be indexed from [0][0].
Returns the vertical alignment (top/middle/bottom) of the cell in the top-left corner of the range.
Returns the vertical alignments of the cells in the range.
Returns the width of the range in columns.
Returns the wrapping policy of the cell in the top-left corner of the range.
Returns the wrapping policy of the cell in the top-left corner of the range. true if the text wraps, false if the text does not.
Returns the wrapping policy of the cells in the range.
Returns true if the range is totally blank.
Determines whether the end of the range is bound to a particular column.
Determines whether the end of the range is bound to a particular column. For example, for the ranges A1:B10 or B:B, which are bound to columns at the end of the range, this method returns true; for the ranges 3:7 or A1:5, which are bound only to particular rows at the end of the range, this method returns false.
Determines whether the end of the range is bound to a particular row.
Determines whether the end of the range is bound to a particular row. For example, for the ranges A1:B10 or 3:7, which are bound to rows at the end of the range, this method returns true; for the ranges B:B or A1:C, which are bound only to particular columns at the end of the range, this method returns false.
Determines whether the start of the range is bound to a particular column.
Determines whether the start of the range is bound to a particular column. For example, for the ranges A1:B10 or B:B, which are bound to columns at the start of the range, this method returns true; for the range 3:7, which is bound only to a row at the start of the range, this method returns false.
Determines whether the start of the range is bound to a particular row.
Determines whether the start of the range is bound to a particular row. For example, for the ranges A1:B10 or 3:7, which are bound to rows at the start of the range, this method returns true; for the range B:B, which is bound only to a particular column at the start of the range, this method returns false.
Merges the cells in the range together into a single block.
Merge the cells in the range across the columns of the range.
Merges the cells in the range together.
Cut and paste (both format and values) from this range to the target range.
Returns a new range that is relative to the current range, whose upper left point is offset from the current range by the given rows and columns, and with the given height and width in cells.
Returns a new range that is relative to the current range, whose upper left point is offset from the current range by the given rows and columns, and with the given height in cells.
Returns a new range that is offset from this range by the given number of rows and columns (which can be negative).
Returns a new range that is offset from this range by the given number of rows and columns (which can be negative). The new range will be the same size as the original range.
Creates an object that can protect the range from being edited except by users who have permission.
Creates an object that can protect the range from being edited except by users who have permission. Until the script actually changes the list of editors for the range (by calling Protection.removeEditor(emailAddress), Protection.removeEditor(user), Protection.removeEditors(emailAddresses), Protection.addEditor(emailAddress), Protection.addEditor(user), Protection.addEditors(emailAddresses), or setting a new value for Protection.setDomainEdit(editable)), the permissions will mirror those of the spreadsheet itself, which effectively means that the range remains unprotected. If the range is already protected, this method creates a new protected range that overlaps the existing one. If a cell is covered by two protected ranges and one of the protected ranges allows a particular user to edit the cell and the other does not, the user will not be able to edit.
Sets the background color of all cells in the range in CSS notation (like '#ffffff' or 'white').
Sets the background to the given RGB color.
Sets the background to the given RGB color. This is a convenience wrapper for the setBackground call that takes a string color.
Sets a rectangular grid of background colors (must match dimensions of this range).
Sets a rectangular grid of background colors (must match dimensions of this range). The colors are in CSS notation (like '#ffffff' or 'white').
Sets the border property.
Sets the border property. Valid values are true (on), false (off) and null (no change).
Sets one data-validation rule for all cells in the range.
Sets the data-validation rules for all cells in the range.
Sets the data-validation rules for all cells in the range. This method takes a two-dimensional array of data validations, indexed by row then by column. The array dimensions must correspond to the range dimensions.
Sets the font color in CSS notation (like '#ffffff' or 'white').
Sets a rectangular grid of font colors (must match dimensions of this range).
Sets a rectangular grid of font colors (must match dimensions of this range). The colors are in CSS notation (like '#ffffff' or 'white').
Sets a rectangular grid of font families (must match dimensions of this range).
Sets a rectangular grid of font families (must match dimensions of this range). Examples of font families are "Arial" or "Helvetica".
Sets the font family, such as "Arial" or "Helvetica".
Sets the line style of the given range ('underline', 'line-through', or 'none').
Sets a rectangular grid of line styles (must match dimensions of this range).
Sets the font size, with the size being the point size to use.
Sets a rectangular grid of font sizes (must match dimensions of this range).
Sets a rectangular grid of font sizes (must match dimensions of this range). The sizes are in points.
Set the font style for the given range ('italic' or 'normal').
Sets a rectangular grid of font styles (must match dimensions of this range).
Set the font weight for the given range (normal/bold).
Sets a rectangular grid of font weights (must match dimensions of this range).
Sets a rectangular grid of font weights (must match dimensions of this range). An example of a font weight is "bold".
Updates the formula for this range.
Updates the formula for this range. The given formula must be in A1 notation.
Updates the formula for this range.
Updates the formula for this range. The given formula must be in R1C1 notation.
Sets a rectangular grid of formulas (must match dimensions of this range).
Sets a rectangular grid of formulas (must match dimensions of this range). The given formulas must be in A1 notation. This method takes a two-dimensional array of formulas, indexed by row, then by column. The array dimensions must correspond to the range dimensions.
Sets a rectangular grid of formulas (must match dimensions of this range).
Sets a rectangular grid of formulas (must match dimensions of this range). The given formulas must be in R1C1 notation.
Set the horizontal (left to right) alignment for the given range (left/center/right).
Sets a rectangular grid of horizontal alignments.
Sets a rectangular grid of horizontal alignments. see setHorizontalAlignment(alignment)
Sets the note to the given value.
Sets a rectangular grid of notes (must match dimensions of this range).
Sets the number or date format to the given formatting string.
Sets the number or date format to the given formatting string. Date formats follow the SimpleDateFormat specification.
Sets a rectangular grid of number or date formats (must match dimensions of this range).
Sets a rectangular grid of number or date formats (must match dimensions of this range). The values are formatting strings, see setNumberFormat(numberFormat). Date formats follow the SimpleDateFormat specification.
Sets the value of the range.
Sets the value of the range. The value can be numeric, string, boolean or date. If it begins with '=' it is interpreted as a formula.
Sets a rectangular grid of values (must match dimensions of this range).
Set the vertical (top to bottom) alignment for the given range (top/middle/bottom).
Sets a rectangular grid of vertical alignments (must match dimensions of this range).
Set the cell wrap of the given range.
Set the cell wrap of the given range. Cells with wrap enabled (the default) will resize to display their full content. Cells with wrap disabled will display as much as possible in the cell without resizing or running to multiple lines.
Sets a rectangular grid of word wrap policies (must match dimensions of this range).
Sets a rectangular grid of word wrap policies (must match dimensions of this range). Cells with wrap enabled (the default) will resize to display their full content. Cells with wrap disabled will display as much as possible in the cell without resizing or running to multiple lines.
Sorts the cells in the given range.
Sorts the cells in the given range. Sorts the cells in a given range, by column and order specified.
Range Access and modify spreadsheet ranges. This class allows users to access and modify ranges in Google Sheets. A range can be a single cell in a sheet or a range of cells in a sheet.