Google apps script 如何解析Google Apps脚本中的Range对象
我需要在Google Apps脚本中解析和编辑范围对象(SpreadsheetApp.getActiveRange())的结果 目标:在谷歌表单中:用户单击一个项目(在a列),然后按下工具栏上的“创建二维码”按钮。这将在后面的行(C列)中放置相应的二维码 我期待类似(伪代码)的东西:Google apps script 如何解析Google Apps脚本中的Range对象,google-apps-script,google-sheets,qr-code,Google Apps Script,Google Sheets,Qr Code,我需要在Google Apps脚本中解析和编辑范围对象(SpreadsheetApp.getActiveRange())的结果 目标:在谷歌表单中:用户单击一个项目(在a列),然后按下工具栏上的“创建二维码”按钮。这将在后面的行(C列)中放置相应的二维码 我期待类似(伪代码)的东西: 不建议分析范围对象。改用: var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var cell = SpreadsheetApp.ge
不建议分析范围对象。改用:
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var cell = SpreadsheetApp.getActiveRange()
//Logger.log(cell) --> "A2"
cell = cell.split("");
cell[0] = "B";
cell = cell.join("")
//Logger.log(cell) --> "B2"
ss.getRange(cell).setFormula('=image("https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl="' + cell'));
SpreadsheetApp
.getActiveRange()
.offset(0,1)
.setFormula('=1+0')