Trait

com.google.appsscript.spreadsheet

Range

Related Doc: package spreadsheet

Permalink

trait Range extends Object

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.

Annotations
@RawJSType()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Range
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def activate(): Range

    Permalink

    Make this range the active range.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def breakApart(): Range

    Permalink

    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.

  7. def canEdit(): Boolean

    Permalink

    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.

  8. def clear(options: AnyRef): Range

    Permalink

    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.

  9. def clear(): Range

    Permalink

    Clears the range of contents, formats, and data-validation rules.

  10. def clearContent(): Range

    Permalink

    Clears the content of the range, leaving the formatting intact.

  11. def clearDataValidations(): Range

    Permalink

    Clears the data-validation rules for the range.

  12. def clearFormat(): Range

    Permalink

    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.

  13. def clearNote(): Range

    Permalink

    Clears the note in the given cell or cells.

  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def copyFormatToRange(sheet: Sheet, column: Int, columnEnd: Int, row: Int, rowEnd: Int): Unit

    Permalink

    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.

  16. def copyFormatToRange(gridId: Int, column: Int, columnEnd: Int, row: Int, rowEnd: Int): Unit

    Permalink

    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().

  17. def copyTo(destination: Range, options: AnyRef): Unit

    Permalink

    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.

  18. def copyTo(destination: Range): Unit

    Permalink

    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.

  19. def copyValuesToRange(sheet: Sheet, column: Int, columnEnd: Int, row: Int, rowEnd: Int): Unit

    Permalink

    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.

  20. def copyValuesToRange(gridId: Int, column: Int, columnEnd: Int, row: Int, rowEnd: Int): Unit

    Permalink

    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().

  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def getA1Notation(): String

    Permalink

    Returns a string description of the range, in A1 notation.

  25. def getBackground(): String

    Permalink

    Returns the background color of the top-left cell in the range (i.e., '#ffffff').

  26. def getBackgrounds(): Array[Array[String]]

    Permalink

    Returns the background colors of the cells in the range (i.e., '#ffffff').

  27. def getCell(row: Int, column: Int): Range

    Permalink

    Returns a given cell within a range.

  28. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  29. def getColumn(): Int

    Permalink

    Returns the starting column position for this range.

  30. def getDataSourceUrl(): String

    Permalink

    Returns a URL for the data in this range, which can be used to create charts and queries.

  31. def getDataTable(firstRowIsHeader: Boolean): DataTable

    Permalink

    Return the data inside this Range as a DataTable.

  32. def getDataTable(): DataTable

    Permalink

    Return the data inside this object as a DataTable.

  33. def getDataValidation(): DataValidation

    Permalink

    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.

  34. def getDataValidations(): Array[Array[DataValidation]]

    Permalink

    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.

  35. def getFontColor(): String

    Permalink

    Returns the font color of the cell in the top-left corner of the range, in CSS notation (like '#ffffff' or 'white').

  36. def getFontColors(): Array[Array[String]]

    Permalink

    Returns the font colors of the cells in the range in CSS notation (like '#ffffff' or 'white').

  37. def getFontFamilies(): Array[Array[String]]

    Permalink

    Returns the font families of the cells in the range.

  38. def getFontFamily(): String

    Permalink

    Returns the font family of the cell in the top-left corner of the range.

  39. def getFontLine(): String

    Permalink

    Gets the line style of the cell in the top-left corner of the range ('underline', 'line-through', or 'none').

  40. def getFontLines(): Array[Array[String]]

    Permalink

    Gets the line style of the cells in the range ('underline', 'line-through', or 'none').

  41. def getFontSize(): Int

    Permalink

    Returns the font size in point size of the cell in the top-left corner of the range.

  42. def getFontSizes(): Array[Array[Int]]

    Permalink

    Returns the font sizes of the cells in the range.

  43. def getFontStyle(): String

    Permalink

    Returns the font style ('italic' or 'normal' of the cell in the top-left corner of the range.

  44. def getFontStyles(): Array[Array[String]]

    Permalink

    Returns the font styles of the cells in the range.

  45. def getFontWeight(): String

    Permalink

    Returns the font weight (normal/bold) of the cell in the top-left corner of the range.

  46. def getFontWeights(): Array[Array[String]]

    Permalink

    Returns the font weights of the cells in the range.

  47. def getFormula(): String

    Permalink

    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.

  48. def getFormulaR1C1(): String

    Permalink

    Returns the formula (R1C1 notation) for a given cell, or null if none.

  49. def getFormulas(): Array[Array[String]]

    Permalink

    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.

  50. def getFormulasR1C1(): Array[Array[String]]

    Permalink

    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.

  51. def getGridId(): Int

    Permalink

    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.

  52. def getHeight(): Int

    Permalink

    Returns the height of the range.

  53. def getHorizontalAlignment(): String

    Permalink

    Returns the horizontal alignment of the text (left/center/right) of the cell in the top-left corner of the range.

  54. def getHorizontalAlignments(): Array[Array[String]]

    Permalink

    Returns the horizontal alignments of the cells in the range.

  55. def getLastColumn(): Int

    Permalink

    Returns the end column position.

  56. def getLastRow(): Int

    Permalink

    Returns the end row position.

  57. def getNote(): String

    Permalink

    Returns the note associated with the given range.

  58. def getNotes(): Array[Array[String]]

    Permalink

    Returns the notes associated with the cells in the range.

  59. def getNumColumns(): Int

    Permalink

    Returns the number of columns in this range.

  60. def getNumRows(): Int

    Permalink

    Returns the number of rows in this range.

  61. def getNumberFormat(): String

    Permalink

    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.

  62. def getNumberFormats(): Array[Array[String]]

    Permalink

    Returns the number formats for the cells in the range.

  63. def getRow(): Int

    Permalink

    Returns the row position for this range.

  64. def getRowIndex(): Int

    Permalink

    Returns the row position for this range.

  65. def getSheet(): Sheet

    Permalink

    Returns the sheet this range belongs to.

  66. def getValue(): AnyRef

    Permalink

    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.

  67. def getValues(): Array[Array[AnyRef]]

    Permalink

    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].

  68. def getVerticalAlignment(): String

    Permalink

    Returns the vertical alignment (top/middle/bottom) of the cell in the top-left corner of the range.

  69. def getVerticalAlignments(): Array[Array[String]]

    Permalink

    Returns the vertical alignments of the cells in the range.

  70. def getWidth(): Int

    Permalink

    Returns the width of the range in columns.

  71. def getWrap(): Boolean

    Permalink

    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.

  72. def getWraps(): Array[Array[Boolean]]

    Permalink

    Returns the wrapping policy of the cells in the range.

  73. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  74. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  75. def isBlank(): Boolean

    Permalink

    Returns true if the range is totally blank.

  76. def isEndColumnBounded(): Boolean

    Permalink

    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.

  77. def isEndRowBounded(): Boolean

    Permalink

    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.

  78. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  79. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  80. def isStartColumnBounded(): Boolean

    Permalink

    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.

  81. def isStartRowBounded(): Boolean

    Permalink

    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.

  82. def merge(): Range

    Permalink

    Merges the cells in the range together into a single block.

  83. def mergeAcross(): Range

    Permalink

    Merge the cells in the range across the columns of the range.

  84. def mergeVertically(): Range

    Permalink

    Merges the cells in the range together.

  85. def moveTo(target: Range): Unit

    Permalink

    Cut and paste (both format and values) from this range to the target range.

  86. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  87. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  88. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  89. def offset(rowOffset: Int, columnOffset: Int, numRows: Int, numColumns: Int): Range

    Permalink

    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.

  90. def offset(rowOffset: Int, columnOffset: Int, numRows: Int): Range

    Permalink

    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.

  91. def offset(rowOffset: Int, columnOffset: Int): Range

    Permalink

    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.

  92. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  93. def protect(): Protection

    Permalink

    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.

  94. def setBackground(color: String): Range

    Permalink

    Sets the background color of all cells in the range in CSS notation (like '#ffffff' or 'white').

  95. def setBackgroundRGB(red: Int, green: Int, blue: Int): Range

    Permalink

    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.

  96. def setBackgrounds(color: Array[Array[String]]): Range

    Permalink

    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').

  97. def setBorder(top: Boolean, left: Boolean, bottom: Boolean, right: Boolean, vertical: Boolean, horizontal: Boolean): Range

    Permalink

    Sets the border property.

    Sets the border property. Valid values are true (on), false (off) and null (no change).

  98. def setDataValidation(rule: DataValidation): Range

    Permalink

    Sets one data-validation rule for all cells in the range.

  99. def setDataValidations(rules: Array[Array[DataValidation]]): Range

    Permalink

    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.

  100. def setFontColor(color: String): Range

    Permalink

    Sets the font color in CSS notation (like '#ffffff' or 'white').

  101. def setFontColors(colors: Array[Array[AnyRef]]): Range

    Permalink

    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').

  102. def setFontFamilies(fontFamilies: Array[Array[AnyRef]]): Range

    Permalink

    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".

  103. def setFontFamily(fontFamily: String): Range

    Permalink

    Sets the font family, such as "Arial" or "Helvetica".

  104. def setFontLine(fontLine: String): Range

    Permalink

    Sets the line style of the given range ('underline', 'line-through', or 'none').

  105. def setFontLines(fontLines: Array[Array[AnyRef]]): Range

    Permalink

    Sets a rectangular grid of line styles (must match dimensions of this range).

  106. def setFontSize(size: Int): Range

    Permalink

    Sets the font size, with the size being the point size to use.

  107. def setFontSizes(sizes: Array[Array[AnyRef]]): Range

    Permalink

    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.

  108. def setFontStyle(fontStyle: String): Range

    Permalink

    Set the font style for the given range ('italic' or 'normal').

  109. def setFontStyles(fontStyles: Array[Array[AnyRef]]): Range

    Permalink

    Sets a rectangular grid of font styles (must match dimensions of this range).

  110. def setFontWeight(fontWeight: String): Range

    Permalink

    Set the font weight for the given range (normal/bold).

  111. def setFontWeights(fontWeights: Array[Array[AnyRef]]): Range

    Permalink

    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".

  112. def setFormula(formula: String): Range

    Permalink

    Updates the formula for this range.

    Updates the formula for this range. The given formula must be in A1 notation.

  113. def setFormulaR1C1(formula: String): Range

    Permalink

    Updates the formula for this range.

    Updates the formula for this range. The given formula must be in R1C1 notation.

  114. def setFormulas(formulas: Array[Array[String]]): Range

    Permalink

    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.

  115. def setFormulasR1C1(formulas: Array[Array[String]]): Range

    Permalink

    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.

  116. def setHorizontalAlignment(alignment: String): Range

    Permalink

    Set the horizontal (left to right) alignment for the given range (left/center/right).

  117. def setHorizontalAlignments(alignments: Array[Array[AnyRef]]): Range

    Permalink

    Sets a rectangular grid of horizontal alignments.

    Sets a rectangular grid of horizontal alignments. see setHorizontalAlignment(alignment)

  118. def setNote(note: String): Range

    Permalink

    Sets the note to the given value.

  119. def setNotes(notes: Array[Array[AnyRef]]): Range

    Permalink

    Sets a rectangular grid of notes (must match dimensions of this range).

  120. def setNumberFormat(numberFormat: String): Range

    Permalink

    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.

  121. def setNumberFormats(numberFormats: Array[Array[AnyRef]]): Range

    Permalink

    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.

  122. def setValue(value: AnyRef): Range

    Permalink

    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.

  123. def setValues(values: Array[Array[AnyRef]]): Range

    Permalink

    Sets a rectangular grid of values (must match dimensions of this range).

  124. def setVerticalAlignment(alignment: String): Range

    Permalink

    Set the vertical (top to bottom) alignment for the given range (top/middle/bottom).

  125. def setVerticalAlignments(alignments: Array[Array[AnyRef]]): Range

    Permalink

    Sets a rectangular grid of vertical alignments (must match dimensions of this range).

  126. def setWrap(isWrapEnabled: Boolean): Range

    Permalink

    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.

  127. def setWraps(isWrapEnabled: Array[Array[AnyRef]]): Range

    Permalink

    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.

  128. def sort(sortSpecObj: AnyRef): Range

    Permalink

    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.

  129. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  130. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  131. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  132. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  133. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  134. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  135. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped