AI-generated Key Takeaways
-
Banding refers to the color patterns applied to rows or columns of a range within a spreadsheet.
-
Each banding is defined by a range and specific colors for its rows, columns, headers, and footers.
-
You can access and modify various color properties of a banding for the first and second alternating rows/columns, as well as header and footer rows/columns.
-
Banding provides methods to copy, remove, and set the range for the banding.
-
Some methods for getting color properties by returning a String color code are deprecated and replaced by methods that return a Color object.
Access and modify bandings, the color patterns applied to rows or columns of a range. Each banding consists of a range and a set of colors for rows, columns, headers, and footers.
Methods
| Method | Return type | Brief description |
|---|---|---|
Banding
|
Copies this banding to another range. | |
Color
|
Returns the first alternating column color in the banding, or null
if no color is set. |
|
Color
|
Returns the first alternating row color, or null
if no color is set. |
|
Color
|
Returns the color of the last column in the banding, or null
if no color is set. |
|
Color
|
Returns the last row color in the banding, or null
if no color is set. |
|
Color
|
Returns the color of the first column in the banding, or null
if no color is set. |
|
Color
|
Returns the color of the header row or null
if no color is set. |
|
Range
|
Returns the range for this banding. | |
Color
|
Returns the second alternating column color in the banding, or null
if no color is set. |
|
Color
|
Returns the second alternating row color, or null
if no color is set. |
|
void
|
Removes this banding. | |
Banding
|
Sets the first column color that is alternating. | |
Banding
|
Sets the first alternating column color in the banding. | |
Banding
|
Sets the first row color that is alternating. | |
Banding
|
Sets the first alternating row color in the banding. | |
Banding
|
Sets the color of the last column. | |
Banding
|
Sets the color of the last column in the banding. | |
Banding
|
Sets the color of the last row. | |
Banding
|
Sets the color of the footer row in the banding. | |
Banding
|
Sets the color of the header column. | |
Banding
|
Sets the color of the header column. | |
Banding
|
Sets the color of the header row. | |
Banding
|
Sets the color of the header row. | |
Banding
|
Sets the range for this banding. | |
Banding
|
Sets the second column color that is alternating. | |
Banding
|
Sets the second alternating column color in the banding. | |
Banding
|
Sets the second row color that is alternating. | |
Banding
|
Sets the second alternating color in the banding. |
Detailed documentation
copy
To(range)
Copies this banding to another range.
Parameters
| Name | Type | Description |
|---|---|---|
range
|
Range
|
The range to copy this banding to. |
Return
Banding
— The new banding.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
First
Column
Color
Object()
Returns the first alternating column color in the banding, or null
if no color is set.
Return
Color
— The first alternating column color in the banding, or null
if no color is set.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
First
Row
Color
Object()
Returns the first alternating row color, or null
if no color is set.
Return
Color
— The first alternating row color in the banding, or null
if no color is set.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
Header
Column
Color
Object()
Returns the color of the first column in the banding, or null
if no color is set.
Return
Color
— The first column color in the banding, or null
if no color is set.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
Header
Row
Color
Object()
Returns the color of the header row or null
if no color is set.
Return
Color
— The color of the header row; returns null
if no color is set.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
Range()
get
Second
Column
Color
Object()
Returns the second alternating column color in the banding, or null
if no color is set.
Return
Color
— The second alternating column color in the banding, or null
if no color is set.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
Second
Row
Color
Object()
Returns the second alternating row color, or null
if no color is set.
Return
Color
— The second alternating row color in the banding, or null
if no color is set.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
remove()
Removes this banding.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
First
Column
Color(color)
Sets the first column color that is alternating.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
String
|
The color code in CSS notation (such as '#ffffff'
or 'white'
), or null
to clear the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
First
Column
Color
Object(color)
Sets the first alternating column color in the banding.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
Color
|
The new first alternating column color in the banding; setting to null
clears the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
First
Row
Color(color)
Sets the first row color that is alternating.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
String
|
The color code in CSS notation (such as '#ffffff'
or 'white'
), or null
to clear the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
First
Row
Color
Object(color)
Sets the first alternating row color in the banding.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
Color
|
The new first alternating color in the banding; setting to null
clears the
color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Header
Column
Color(color)
Sets the color of the header column.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
String
|
The color code in CSS notation (such as '#ffffff'
or 'white'
), or null
to clear the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Header
Column
Color
Object(color)
Sets the color of the header column.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
Color
|
The new header column color; setting to null
clears the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Header
Row
Color(color)
Sets the color of the header row.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
String
|
The color code in CSS notation (such as '#ffffff'
or 'white'
), or null
to clear the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Header
Row
Color
Object(color)
Sets the color of the header row.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
Color
|
The new header row color; setting to null
clears the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Range(range)
Sets the range for this banding.
Parameters
| Name | Type | Description |
|---|---|---|
range
|
Range
|
The new range for this banding. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Second
Column
Color(color)
Sets the second column color that is alternating.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
String
|
The color code in CSS notation (such as '#ffffff'
or 'white'
), or null
to clear the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Second
Column
Color
Object(color)
Sets the second alternating column color in the banding.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
Color
|
The new second alternating column color in the banding; setting to null
clears the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Second
Row
Color(color)
Sets the second row color that is alternating.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
String
|
The color code in CSS notation (such as '#ffffff'
or 'white'
), or null
to clear the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set
Second
Row
Color
Object(color)
Sets the second alternating color in the banding.
Parameters
| Name | Type | Description |
|---|---|---|
color
|
Color
|
The new second alternating color in the banding; setting to null
clears
the color. |
Return
Banding
— This banding, for chaining.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets

