๐Range
Google Apps Script class for Google Sheet
Range ็ไฝ็ฝฎ่ณ่จ๏ผ
getRow() - starting row index.
getColumn() - starting column index.
getNumRows() - number of rows.
getNumColumns() - number of columns.
้ธๅ Range๏ผ
๐พ sheet.rangeByRect() - ็ฐกๅ Range ็้ธๅใ
range.offset() - ๅฆๆไฝ็งป็้ๆฒๆ่จญๅฅฝ๏ผๆๅบ็พ้กไผผไปฅไธ้ฏ่ชค๏ผ โ Exception: The starting row of the range is too small.
่จญๅฎๅฒๅญๆ ผๅ ฌๅผ๏ผ
ๅไฝตๅฒๅญๆ ผ๏ผ
ๆฐดๅนณๅไฝต๏ผmergeAcross() (ๅฆๆๆๅฅฝๅนพๅ๏ผๆฏๅๆๅๅฅๅไฝต)
ๅ็ดๅไฝต๏ผmergeVertically()
่จญๅฎๅญ้ซ๏ผ
ๅญ้ซ้ก่ฒ๏ผsetFontColor(), setFontColors(), setFontColorObject(), ...
ๅญ้ซๅคงๅฐ๏ผsetFontSize()
ๅญ้ซ็ฒ็ดฐ๏ผsetFontWeight()
ๅไธๅๅฒๅญๆ ผๅ ง่จญๅฎไธๅ็ๅญ้ซ๏ผ range.setRichTextValue() โญ๏ธ
่จญๅฎ้ก่ฒ๏ผ
ๅฒๅญๆ ผ่ๆฏ่ฒ๏ผsetBackground()
ๆๅญๅฐ้ฝ๏ผ
// column widths
sheet.setColumnWidths(startColumn, numColumns, width)
// background color
range.setBackground('red') // ไฝฟ็จ้ก่ฒๅ็จฑ
range.setBackground('#eeeeee') // ไฝฟ็จ RGB ้ก่ฒ็ขผ
range.setBackground() // ้่จญ่ๆฏ่ฒ
// alignment
range
.setVerticalAlignment('middle') // 'top', 'middle', 'bottom'
.setHorizontalAlignment('center'); // 'left', 'center', 'normal'app.range.prototype - extend Range.
app.sheet.prototype - extend Sheet.
๐พ sheet.rangeByRect() - ็ฐกๅ้ธๅ Range
๐ก custom prototypes for Range objects.
GAS โฉ ThemeColorType (enum)
Range โฉ
getA1Notation() - ๅๅณ้กไผผ
"A1:E2"็ๅญไธฒใoffset() - another range.
getSheet() - sheet (Sheet) this range belongs to.
Sheet โฉ getRangeList(a1Notations)
Cells - internal data structure of a cell
็ธ้่ฉฆ็ฎ่กจๆไปค๏ผ
=ADDRESS() - row/col number to A1/R1C1 notation.
=ROW() - row number of a cell.
=COLUMN() - column number of a cell.
Last updated
Was this helpful?