谷歌应用程序脚本功能,可以在电子表格中获得一定的色彩 [英] google apps script function that gets a certain colomn in spreadsheet
问题描述
我可以创建一个Google应用程序脚本,从应用程序电子表格中的整个Colomn获取信息并对其执行操作吗?
我已经搜索了类电子表格链接 https://developers.google.com/apps-script/class_spreadsheet
但是我不知道我将要使用哪种方法,任何人都可以帮助我推送?我对Google应用程序脚本不熟悉
.getRange()
方法来选择你想要的单元格。然后为了获得所有的值,可以调用 .getValues()
。示例: var vals = sheet.getRange(C2:C)。getValues();
现在 vals
是一个二维数组,可通过 vals [rowNum] [colNum]
访问。如果您只抓取一列, colNum
将始终为 0
。
Can I create a Google apps script that gets information from a whole Colomn in a apps spreadsheet and do upon it an action?
I've searched the Class spreadsheet link https://developers.google.com/apps-script/class_spreadsheet but i don't know which method I am going to use actually, anyone can help giving me a push? I am new to the Google apps scripts
Always use the .getRange()
method to select what cells you want. Then to get all the values, you call .getValues()
. Example:
var vals = sheet.getRange("C2:C").getValues();
Now vals
is a 2 dimensional array that is accessible by vals[rowNum][colNum]
. If you're grabbing only one column, the colNum
will always be 0
.
这篇关于谷歌应用程序脚本功能,可以在电子表格中获得一定的色彩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!