This service allows scripts to create, access, and modify Google Sheets files. See also the guide to storing data in spreadsheets.
NameBrief description
An enumeration of the types of series used to calculate auto-filled values.
Styles that can be set on a range using Range.setBorder(top, left, bottom,right, vertical, horizontal, color, style)
.
The chart's position within a sheet.
This class allows users to access existing data-validation rules.
Builder for data-validation rules.
An enumeration representing the data-validation criteria that can be set on a range.
Builder for area charts.
Builder for bar charts.
Represents a chart that has been embedded into a Spreadsheet.
This builder allows you to edit an EmbeddedChart
.
Builder for column charts.
Builder for combo charts.
Builder for histogram charts.
Builder for line charts.
Builder for pie charts.
Builder for scatter charts.
Builder for table charts.
Create, access and modify named ranges in a spreadsheet.
Access and modify protected sheets in the older version of Google Sheets.
Access and modify protected ranges and sheets.
An enumeration representing the parts of a spreadsheet that can be protected from edits.
Access and modify spreadsheet ranges.
Access and modify spreadsheet sheets.
This class allows users to access and modify Google Sheets files.
This class allows users to open Google Sheets files and to create new ones.
PropertyTypeDescription
DEFAULT_SERIES
Enum
ALTERNATE_SERIES
Enum
PropertyTypeDescription
DOTTED
Enum
Dotted line borders.
DASHED
Enum
Dashed line borders.
SOLID
Enum
Thin solid line borders.
SOLID_MEDIUM
Enum
Medium solid line borders.
SOLID_THICK
Enum
Thick solid line borders.
DOUBLE
Enum
Two solid line borders.
MethodReturn typeBrief description
getAnchorColumn()
Integer
The chart's left side will be anchored in this column.
getAnchorRow()
Integer
The chart's top side will be anchored in this row.
getOffsetX()
Integer
The chart's upper left hand corner will be offset from the anchor column by this many pixels.
getOffsetY()
Integer
Chart's upper left hand corner will be offset from the anchor row by this many pixels.
MethodReturn typeBrief description
Creates a builder for a data-validation rule based on this rule's settings.
getAllowInvalid()
Boolean
Returns true
if the rule shows a warning when input fails data validation, or false
if it rejects the input entirely.
Gets the rule's criteria type as defined in the DataValidationCriteria
enum.
getCriteriaValues()
Object[]
Gets an array of arguments for the rule's criteria.
getHelpText()
String
Gets the rule's help text, or null
if no help text is set.
MethodReturn typeBrief description
Constructs a data-validation rule from the settings applied to the builder.
Creates a builder for a data-validation rule based on this rule's settings.
getAllowInvalid()
Boolean
Returns true
if the rule shows a warning when input fails data validation, or false
if it rejects the input entirely.
Gets the rule's criteria type as defined in the DataValidationCriteria
enum.
getCriteriaValues()
Object[]
Gets an array of arguments for the rule's criteria.
getHelpText()
String
Gets the rule's help text, or null
if no help text is set.
Sets the data-validation rule to require a date.
Sets the data-validation rule to require a date after the given value.
Sets the data-validation rule to require a date before the given value.
Sets the data-validation rule to require a date between the given values, inclusive of the values themselves.
Sets the data-validation rule to require a date equal to the given value.
Sets the data-validation rule to require a date not between the given values, inclusive of the values themselves.
Sets the data-validation rule to require a date on or after the given value.
Sets the data-validation rule to require a date on or before the given value.
Sets the data-validation rule to require that the given formula evaluates to true
.
Sets the data-validation rule to require a number between the given values, inclusive of the values themselves.
Sets the data-validation rule to require a number equal to the given value.
Sets the data-validation rule to require a number greater than the given value.
Sets the data-validation rule to require a number greater than or equal to the given value.
Sets the data-validation rule to require a number less than the given value.
Sets the data-validation rule to require a number less than or equal to the given value.
Sets the data-validation rule to require a number not between the given values, inclusive of the values themselves.
Sets the data-validation rule to require a number not equal to the given value.
Sets the data-validation rule to require that the input contains the given value.
Sets the data-validation rule to require that the input does not contain the given value.
Sets the data-validation rule to require that the input is equal to the given value.
Sets the data-validation rule to require that the input is in the form of an email address.
Sets the data-validation rule to require that the input is in the form of a URL.
Sets the data-validation rule to require that the input is equal to one of the given values.
Sets the data-validation rule to require that the input is equal to one of the given values, with an option to hide the dropdown menu.
Sets the data-validation rule to require that the input is equal to a value in the given range.
Sets the data-validation rule to require that the input is equal to a value in the given range, with an option to hide the dropdown menu.
Sets whether to show a warning when input fails data validation or whether to reject the input entirely.
Sets the help text shown when the user hovers over the cell on which data-validation is set.
Sets the data-validation rule to require criteria defined in the DataValidationCriteria
enum.
PropertyTypeDescription
DATE_AFTER
Enum
Requires a date that is after the given value.
DATE_BEFORE
Enum
Requires a date that is before the given value.
DATE_BETWEEN
Enum
Requires a date that is between the given values.
DATE_EQUAL_TO
Enum
Requires a date that is equal to the given value.
DATE_IS_VALID_DATE
Enum
Requires a date.
DATE_NOT_BETWEEN
Enum
Requires a date that is not between the given values.
DATE_ON_OR_AFTER
Enum
Require a date that is on or after the given value.
DATE_ON_OR_BEFORE
Enum
Requires a date that is on or before the given value.
NUMBER_BETWEEN
Enum
Requires a number that is between the given values.
NUMBER_EQUAL_TO
Enum
Requires a number that is equal to the given value.
NUMBER_GREATER_THAN
Enum
Require a number that is greater than the given value.
NUMBER_GREATER_THAN_OR_EQUAL_TO
Enum
Requires a number that is greater than or equal to the given value.
NUMBER_LESS_THAN
Enum
Requires a number that is less than the given value.
NUMBER_LESS_THAN_OR_EQUAL_TO
Enum
Requires a number that is less than or equal to the given value.
NUMBER_NOT_BETWEEN
Enum
Requires a number that is not between the given values.
NUMBER_NOT_EQUAL_TO
Enum
Requires a number that is not equal to the given value.
TEXT_CONTAINS
Enum
Requires that the input contains the given value.
TEXT_DOES_NOT_CONTAIN
Enum
Requires that the input does not contain the given value.
TEXT_EQUAL_TO
Enum
Requires that the input is equal to the given value.
TEXT_IS_VALID_EMAIL
Enum
Requires that the input is in the form of an email address.
TEXT_IS_VALID_URL
Enum
Requires that the input is in the form of a URL.
VALUE_IN_LIST
Enum
Requires that the input is equal to one of the given values.
VALUE_IN_RANGE
Enum
Requires that the input is equal to a value in the given range.
CUSTOM_FORMULA
Enum
Requires that the input makes the given formula evaluate to true
.
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the style for points in the line.
Sets the position, changing where the chart appears on the sheet.
Sets the range for the chart.
Uses stacked lines, meaning that line and bar values are stacked (accumulated).
Sets the title of the chart.
Sets the text style of the chart title.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
Makes the range axis into a logarithmic scale (requires all values to be positive).
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Reverses the direction in which the bars grow along the horizontal axis.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
Sets the range for the chart.
Uses stacked lines, meaning that line and bar values are stacked (accumulated).
Sets the title of the chart.
Sets the text style of the chart title.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
Makes the range axis into a logarithmic scale (requires all values to be positive).
MethodReturn typeBrief description
Return the data inside this object as a blob converted to the specified content type.
Return the data inside this object as a blob.
Returns information about where the chart is positioned within a sheet.
getId()
String
Returns the id that has been assigned to this object.
Returns the options for this chart, such as height, colors, axes, etc.
Returns the Ranges that this chart uses as a data source.
getType()
String
Gets the type of this object.
Returns an EmbeddedChartBuilder
that can be used to modify this chart.
Sets the id of this EmbeddedChart
to be used with UiApp.
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Changes the type of chart.
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
Sets the range for the chart.
Uses stacked lines, meaning that line and bar values are stacked (accumulated).
Sets the title of the chart.
Sets the text style of the chart title.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
Makes the range axis into a logarithmic scale (requires all values to be positive).
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
Sets the range for the chart.
Uses stacked lines, meaning that line and bar values are stacked (accumulated).
Sets the title of the chart.
Sets the text style of the chart title.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
Makes the range axis into a logarithmic scale (requires all values to be positive).
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
Sets the range for the chart.
Uses stacked lines, meaning that line and bar values are stacked (accumulated).
Sets the title of the chart.
Sets the text style of the chart title.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
Makes the range axis into a logarithmic scale (requires all values to be positive).
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the style to use for curves in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the style for points in the line.
Sets the position, changing where the chart appears on the sheet.
Sets the range for the chart.
Sets the title of the chart.
Sets the text style of the chart title.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
Makes the range axis into a logarithmic scale (requires all values to be positive).
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Reverses the drawing of series in the domain axis.
Sets the chart to be three-dimensional.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
Sets the title of the chart.
Sets the text style of the chart title.
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Sets the background color for the chart.
Changes the type of chart.
Sets the colors for the lines in the chart.
Sets the position of the legend with respect to the chart.
Sets the text style of the chart legend.
Sets advanced options for this chart.
Sets the style for points in the line.
Sets the position, changing where the chart appears on the sheet.
Sets the title of the chart.
Sets the text style of the chart title.
Makes the horizontal axis into a logarithmic scale (requires all values to be positive).
Sets the range for the horizontal axis of the chart.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Sets the horizontal axis title text style.
Makes the vertical axis into a logarithmic scale (requires all values to be positive).
Sets the range for the vertical axis of the chart.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Sets the vertical axis title text style.
MethodReturn typeBrief description
Adds a Range to the chart represented by this builder.
Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder
.
Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder
.
Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder
.
Sets the chart type to ComboChart and returns an EmbeddedComboChartBuilder
.
Sets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder
.
Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder
.
Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder
.
Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder
.
Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder
.
Builds the chart to reflect all changes made to it.
Sets whether to enable paging through the data.
Enables paging and sets the number of rows in each page.
Enables paging, sets the number of rows in each page and the first table page to display (page numbers are zero based).
Adds basic support for right-to-left languages (such as Arabic or Hebrew) by reversing the column order of the table, so that column zero is the right-most column, and the last column is the left-most column.
Sets whether to sort columns when the user clicks a column heading.
Returns the current chart type.
Return the ContainerInfo, which encapsulates where the chart appears on the sheet.
Returns a copy of the list of ranges currently providing data for this chart.
Removes the specified Range from the chart represented by this builder.
Changes the type of chart.
Sets the row number for the first row in the data table.
Sets the index of the column according to which the table should be initially sorted (ascending).
Sets the index of the column according to which the table should be initially sorted (descending).
Sets advanced options for this chart.
Sets the position, changing where the chart appears on the sheet.
Sets whether to show the row number as the first column of the table.
Sets whether alternating color style will be assigned to odd and even rows of a table chart.
MethodReturn typeBrief description
getName()
String
Gets the name of this named range.
Gets the range referenced by this named range.
remove()
void
Deletes this named range.
Sets/updates the name of the named range.
Sets/updates the range for this named range.
MethodReturn typeBrief description
Adds the given user to the list of editors for the protected sheet or range.
Adds the given user to the list of editors for the protected sheet or range.
Adds the given array of users to the list of editors for the protected sheet or range.
canDomainEdit()
Boolean
Determines whether all users in the domain that owns the spreadsheet have permission to edit the protected range or sheet.
canEdit()
Boolean
Determines whether the user has permission to edit the protected range or sheet.
getDescription()
String
Gets the description of the protected range or sheet.
Gets the list of editors for the protected range or sheet.
Gets the type of the protected area, either SpreadsheetApp.ProtectionType.RANGE
or SpreadsheetApp.ProtectionType.SHEET
.
Gets the range that is being protected.
getRangeName()
String
Gets the name of the protected range if it is associated with a named range.
Gets an array of unprotected ranges within a protected sheet.
isWarningOnly()
Boolean
Determines if the protected area is using "warning based" protection.
remove()
void
Unprotects the range or sheet.
Removes the given user from the list of editors for the protected sheet or range.
Removes the given user from the list of editors for the protected sheet or range.
Removes the given array of users from the list of editors for the protected sheet or range.
Sets the description of the protected range or sheet.
Sets whether all users in the domain that owns the spreadsheet have permission to edit the protected range or sheet.
Associates the protected range with an existing named range.
Adjusts the range that is being protected.
Associates the protected range with an existing named range.
Unprotects the given array of ranges within a protected sheet.
Sets whether or not this protected range is using "warning based" protection.
PropertyTypeDescription
RANGE
Enum
Protection for a range.
SHEET
Enum
Protection for a sheet.
MethodReturn typeBrief description
Make this range the active range.
Fills the destinationRange
with data based on the data in this range.
Calculates a range to fill with new data based on neighboring cells and automatically fills that range with new values based on the data contained in this range.
Break any multi-column cells in the range into individual cells again.
canEdit()
Boolean
Determines whether the user has permission to edit every cell in the range.
Clears the range of contents, formats, and data-validation rules.
Clears the range of contents, format, data-validation rules, and/or comments, as specified with the given advanced options.
Clears the content of the range, leaving the formatting intact.
Clears the data-validation rules for the range.
Clears formatting for this range.
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.
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.
Copy the content of the range to the given location.
Copy the content of the range to the given location.
getA1Notation()
String
Returns a string description of the range, in A1 notation.
getBackground()
String
Returns the background color of the top-left cell in the range (i.e., '#ffffff'
).
getBackgrounds()
String[][]
Returns the background colors of the cells in the range (i.e., '#ffffff'
).
Returns a given cell within a range.
getColumn()
Integer
Returns the starting column position for this range.
getDataSourceUrl()
String
Returns a URL for the data in this range, which can be used to create charts and queries.
Return the data inside this object as a DataTable.
Return the data inside this Range as a DataTable.
Returns the data-validation rule for the top-left cell in the range.
Returns the data-validation rules for all cells in the range.
getDisplayValue()
String
Returns the displayed value of the top-left cell in the range.
getDisplayValues()
String[][]
Returns the rectangular grid of values for this range.
getFontColor()
String
Returns the font color of the cell in the top-left corner of the range, in CSS notation (like '#ffffff'
or 'white'
).
getFontColors()
String[][]
Returns the font colors of the cells in the range in CSS notation (like '#ffffff'
or 'white'
).
getFontFamilies()
String[][]
Returns the font families of the cells in the range.
getFontFamily()
String
Returns the font family of the cell in the top-left corner of the range.
getFontLine()
String
Gets the line style of the cell in the top-left corner of the range ('underline'
, 'line-through'
, or 'none'
).
getFontLines()
String[][]
Gets the line style of the cells in the range ('underline'
, 'line-through'
, or 'none'
).
getFontSize()
Integer
Returns the font size in point size of the cell in the top-left corner of the range.
getFontSizes()
Integer[][]
Returns the font sizes of the cells in the range.
getFontStyle()
String
Returns the font style ('italic'
or 'normal'
) of the cell in the top-left corner of the range.
getFontStyles()
String[][]
Returns the font styles of the cells in the range.
getFontWeight()
String
Returns the font weight (normal/bold) of the cell in the top-left corner of the range.
getFontWeights()
String[][]
Returns the font weights of the cells in the range.
getFormula()
String
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.
getFormulaR1C1()
String
Returns the formula (R1C1 notation) for a given cell, or null
if none.
getFormulas()
String[][]
Returns the formulas (A1 notation) for the cells in the range.
getFormulasR1C1()
String[][]
Returns the formulas (R1C1 notation) for the cells in the range.
getGridId()
Integer
Returns the grid ID of the range's parent sheet.
getHeight()
Integer
Returns the height of the range.
getHorizontalAlignment()
String
Returns the horizontal alignment of the text (left/center/right) of the cell in the top-left corner of the range.
getHorizontalAlignments()
String[][]
Returns the horizontal alignments of the cells in the range.
getLastColumn()
Integer
Returns the end column position.
getLastRow()
Integer
Returns the end row position.
Returns an array of Range objects representing merged cells that either are fully within the current range, or contain at least one cell in the current range."
getNote()
String
Returns the note associated with the given range.
getNotes()
String[][]
Returns the notes associated with the cells in the range.
getNumColumns()
Integer
Returns the number of columns in this range.
getNumRows()
Integer
Returns the number of rows in this range.
getNumberFormat()
String
Get the number or date formatting of the top-left cell of the given range.
getNumberFormats()
String[][]
Returns the number or date formats for the cells in the range.
getRow()
Integer
Returns the row position for this range.
getRowIndex()
Integer
Returns the row position for this range.
Returns the sheet this range belongs to.
getValue()
Object
Returns the value of the top-left cell in the range.
getValues()
Object[][]
Returns the rectangular grid of values for this range.
getVerticalAlignment()
String
Returns the vertical alignment (top/middle/bottom) of the cell in the top-left corner of the range.
getVerticalAlignments()
String[][]
Returns the vertical alignments of the cells in the range.
getWidth()
Integer
Returns the width of the range in columns.
getWrap()
Boolean
Returns the wrapping policy of the cell in the top-left corner of the range.
getWraps()
Boolean[][]
Returns the wrapping policy of the cells in the range.
isBlank()
Boolean
Returns true
if the range is totally blank.
isEndColumnBounded()
Boolean
Determines whether the end of the range is bound to a particular column.
isEndRowBounded()
Boolean
Determines whether the end of the range is bound to a particular row.
isPartOfMerge()
Boolean
Returns true if the cells in the current range overlap any merged cells.
isStartColumnBounded()
Boolean
Determines whether the start of the range is bound to a particular column.
isStartRowBounded()
Boolean
Determines whether the start of the range is bound to a particular row.
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.
moveTo(target)
void
Cut and paste (both format and values) from this range to the target range.
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 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 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.
Creates an object that can protect the range from being edited except by users who have permission.
Randomizes the order of the rows in the given range.
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 a rectangular grid of background colors (must match dimensions of this range).
Sets the border property.
Sets the border property with color and/or style.
Sets one data-validation rule for all cells in the range.
Sets the data-validation rules for all cells in the range.
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 families (must match dimensions of this range).
Sets the font family, such as "Arial" or "Helvetica".
Sets the font 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).
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).
Updates the formula for this range.
Updates the formula for this range.
Sets a rectangular grid of formulas (must match dimensions of this range).
Sets a rectangular grid of formulas (must match dimensions of this range).
Set the horizontal (left to right) alignment for the given range (left/center/right).
Sets a rectangular grid of horizontal alignments.
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 a rectangular grid of number or date formats (must match dimensions of this range).
Sets the value of the range.
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.
Sets a rectangular grid of word wrap policies (must match dimensions of this range).
Sorts the cells in the given range.
MethodReturn typeBrief description
Activates this sheet.
Appends a row to the spreadsheet.
Sets the width of the given column to fit its contents
Clears the sheet of content and formatting information.
Clears the sheet of contents and/or format, as specified with the given advanced options.
Clears the sheet of contents, while preserving formatting information.
Clears the sheet of formatting, while preserving contents.
Clears the sheet of all notes.
Copies the sheet to a given spreadsheet, which can be the same spreadsheet as the source.
Deletes the column at the given column position.
Deletes a number of columns starting at the given column position.
Deletes the row at the given row position.
Deletes a number of rows starting at the given row position.
Returns the active cell in this sheet.
Returns the active range for the active sheet.
Returns an array of charts on this sheet.
Gets the width in pixels of the given column.
Returns a Range
corresponding to the dimensions in which data is present.
getFormUrl()
String
Returns the URL for the form that sends its responses to this sheet, or null if this sheet has no associated form.
getFrozenColumns()
Integer
Returns the number of frozen columns.
getFrozenRows()
Integer
Returns the number of frozen rows.
getIndex()
Integer
Gets the position of the sheet in its parent spreadsheet.
getLastColumn()
Integer
Returns the position of the last column that has content.
getLastRow()
Integer
Returns the position of the last row that has content.
getMaxColumns()
Integer
Returns the current number of columns in the sheet, regardless of content.
getMaxRows()
Integer
Returns the current number of rows in the sheet, regardless of content.
getName()
String
Returns the name of the sheet.
Gets all the named ranges in this sheet.
Returns the Spreadsheet that contains this sheet.
Gets an array of objects representing all protected ranges in the sheet, or a single-element array representing the protection on the sheet itself.
Returns the range with the top left cell at the given coordinates.
Returns the range with the top left cell at the given coordinates, and with the given number of rows.
Returns the range with the top left cell at the given coordinates with the given number of rows and columns.
Returns the range as specified in A1 notation or R1C1 notation.
getRowHeight(rowPosition)
Integer
Gets the height in pixels of the given row.
getSheetId()
Integer
Returns the ID of the sheet represented by this object.
getSheetName()
String
Returns the sheet name.
Returns the rectangular grid of values for this range starting at the given coordinates.
getTabColor()
String
Gets the sheet tab color, or null if the sheet tab has no color.
Hides the columns in the given range.
Hides the column at the given index.
Hides one or more consecutive columns starting at the given index.
hideRow(row)
void
Hides the rows in the given range.
Hides the row at the given index.
Hides one or more consecutive rows starting at the given index.
Hides this sheet.
Adds a new chart to this sheet.
Inserts a column after the given column position.
Inserts a column before the given column position.
Inserts a blank column in a sheet at the specified location.
Inserts one or more consecutive blank columns in a sheet starting at the specified location.
Inserts a number of columns after the given column position.
Inserts a number of columns before the given column position.
Inserts a Blob
as an image in the document at a given row and column.
Inserts a Blob
as an image in the document at a given row and column, with a pixel offset.
Inserts an image in the document at a given row and column.
Inserts an image in the document at a given row and column, with a pixel offset.
Inserts a row after the given row position.
Inserts a row before the given row position.
Inserts a blank row in a sheet at the specified location.
Inserts one or more consecutive blank rows in a sheet starting at the specified location.
Inserts a number of rows after the given row position.
Inserts a number of rows before the given row position.
isSheetHidden()
Boolean
Returns true if the sheet is currently hidden.
Moves the columns selected by the given range to the position indicated by the destinationIndex
.
Moves the rows selected by the given range to the position indicated by the destinationIndex
.
Returns a builder to create a new chart for this sheet.
Creates an object that can protect the sheet from being edited except by users who have permission.
Removes a chart from the parent sheet.
Sets the active range for the active sheet.
Sets the active selection region for this sheet.
Sets the active selection, as specified in A1 notation or R1C1 notation.
Sets the width of the given column in pixels.
Freezes the given number of columns.
Freezes the given number of rows.
Sets the sheet name.
Sets the row height of the given row in pixels.
Sets the sheet tab color.
Unhides the column at the given index.
Unhides one or more consecutive columns starting at the given index.
Unhides the row at the given index.
Unhides one or more consecutive rows starting at the given index.
Makes the sheet visible.
Sorts a sheet by column, ascending.
Sorts a sheet by column.
Unhides the column in the given range.
unhideRow(row)
void
Unhides the row in the given range.
Updates the chart on this sheet.
MethodReturn typeBrief description
Adds the given user to the list of editors for the Spreadsheet
.
Adds the given user to the list of editors for the Spreadsheet
.
Adds the given array of users to the list of editors for the Spreadsheet
.
Creates a new menu in the Spreadsheet UI.
Adds the given user to the list of viewers for the Spreadsheet
.
Adds the given user to the list of viewers for the Spreadsheet
.
Adds the given array of users to the list of viewers for the Spreadsheet
.
Appends a row to the spreadsheet.
Sets the width of the given column to fit its contents
Copies the spreadsheet and returns the new one.
Deletes the currently active sheet.
Deletes the column at the given column position.
Deletes a number of columns starting at the given column position.
Deletes the row at the given row position.
Deletes a number of rows starting at the given row position.
Deletes the specified sheet.
Duplicates the active sheet and makes it the active sheet.
Returns the active cell in this sheet.
Returns the active range for the active sheet.
Gets the active sheet in a spreadsheet.
Return the data inside this object as a blob converted to the specified content type.
Return the data inside this object as a blob.
Gets the width in pixels of the given column.
Returns a Range
corresponding to the dimensions in which data is present.
Gets the list of editors for this Spreadsheet
.
getFormUrl()
String
Returns the URL for the form that sends its responses to this spreadsheet, or null if this spreadsheet has no associated form.
getFrozenColumns()
Integer
Returns the number of frozen columns.
getFrozenRows()
Integer
Returns the number of frozen rows.
getId()
String
Gets a unique identifier for this spreadsheet.
getLastColumn()
Integer
Returns the position of the last column that has content.
getLastRow()
Integer
Returns the position of the last row that has content.
getName()
String
Gets the name of the document.
Gets all the named ranges in this spreadsheet.
getNumSheets()
Integer
Returns the number of sheets in this spreadsheet.
Returns the owner of the document.
Gets an array of objects representing all protected ranges or sheets in the spreadsheet.
Returns the range as specified in A1 notation or R1C1 notation.
Returns a named range, or null
if no range with the given name is found.
getRowHeight(rowPosition)
Integer
Gets the height in pixels of the given row.
Returns a sheet with the given name.
getSheetId()
Integer
Returns the ID of the sheet represented by this object.
getSheetName()
String
Returns the sheet name.
Returns the rectangular grid of values for this range starting at the given coordinates.
Gets all the sheets in this spreadsheet.
getSpreadsheetLocale()
String
Gets the spreadsheet locale.
getSpreadsheetTimeZone()
String
Gets the time zone for the spreadsheet.
getUrl()
String
Returns the url for the given spreadsheet.
Gets the list of viewers and commenters for this Spreadsheet
.
Hides the columns in the given range.
hideRow(row)
void
Hides the rows in the given range.
Inserts a column after the given column position.
Inserts a column before the given column position.
Inserts a number of columns after the given column position.
Inserts a number of columns before the given column position.
Inserts a Blob
as an image in the document at a given row and column.
Inserts a Blob
as an image in the document at a given row and column, with a pixel offset.
Inserts an image in the document at a given row and column.
Inserts an image in the document at a given row and column, with a pixel offset.
Inserts a row after the given row position.
Inserts a row before the given row position.
Inserts a number of rows after the given row position.
Inserts a number of rows before the given row position.
Inserts a new sheet in the spreadsheet, with a default name.
Inserts a new sheet in the spreadsheet at the given index.
Inserts a new sheet in the spreadsheet at the given index and uses optional advanced arguments.
Inserts a new sheet in the spreadsheet, with a default name and uses optional advanced arguments.
Inserts a new sheet in the spreadsheet with the given name.
Inserts a new sheet in the spreadsheet with the given name at the given index.
Inserts a new sheet in the spreadsheet with the given name at the given index and uses optional advanced arguments.
Inserts a new sheet in the spreadsheet with the given name and uses optional advanced arguments.
Moves the active sheet to the given position in the list of sheets.
Removes the given user from the list of editors for the Spreadsheet
.
Removes the given user from the list of editors for the Spreadsheet
.
removeMenu(name)
void
Removes a menu that was added by addMenu(name, subMenus)
.
Deletes a named range with the given name.
Removes the given user from the list of viewers and commenters for the Spreadsheet
.
Removes the given user from the list of viewers and commenters for the Spreadsheet
.
rename(newName)
void
Renames the document.
Renames the current active sheet to the given new name.
Sets the active range for the active sheet.
Sets the active selection region for this sheet.
Sets the active selection, as specified in A1 notation or R1C1 notation.
Sets the given sheet to be the active sheet in the spreadsheet.
Sets the width of the given column in pixels.
Freezes the given number of columns.
Freezes the given number of rows.
Names a range.
Sets the row height of the given row in pixels.
Sets the spreadsheet locale.
Sets the time zone for the spreadsheet.
Displays a custom user interface component in a dialog centered in the user's browser's viewport.
Sorts a sheet by column, ascending.
Sorts a sheet by column.
toast(msg)
void
Shows a popup window in the lower right corner of the spreadsheet with the given message.
Shows a popup window in the lower right corner of the spreadsheet with the given message and title.
Shows a popup window in the lower right corner of the spreadsheet with the given title and message, that stays visible for a certain length of time.
Unhides the column in the given range.
unhideRow(row)
void
Unhides the row in the given range.
Updates a menu that was added by addMenu(name, subMenus)
.
PropertyTypeDescription
AutoFillSeries
AutoFillSeries
An enumeration of the types of series used to calculate auto-filled values.
BorderStyle
BorderStyle
An enumeration of the valid styles for setting borders on a Range
.
DataValidationCriteria
DataValidationCriteria
An enumeration representing the data-validation criteria that can be set on a range.
ProtectionType
ProtectionType
An enumeration representing the parts of a spreadsheet that can be protected from edits.
MethodReturn typeBrief description
Creates a new spreadsheet with the given name.
Creates a new spreadsheet with the given name and the specified number of rows and columns.
flush()
void
Applies all pending Spreadsheet changes.
Returns the currently active spreadsheet, or null if there is none.
Returns the range of cells that is currently considered active.
Gets the active sheet in a spreadsheet.
Returns the currently active spreadsheet, or null if there is none.
Returns an instance of the spreadsheet's user-interface environment that allows the script to add features like menus, dialogs, and sidebars.
Creates a builder for a data-validation rule.
Opens the spreadsheet that corresponds to the given File object.
Opens the spreadsheet with the given ID.
Opens the spreadsheet with the given url.
Sets the active range for the application.
Sets the active sheet in a spreadsheet.
Sets the active spreadsheet.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
最終更新日: 10月 20, 2017