问题
I want to be able to put my variable row into the
.setValue("=SUM(B54:BA54)")
Actually I need the value of row to replace B54:B54
. I'm looking for something like
.setValue("=SUM(B+row+:BA+row)")
So if row = 50
the setValue
will put =SUM(B50:BA50)
in the cell
var text3 = result3.getResponseText();
var row = parseInt(text3);
activeSheet.getRange(row+3,55).setValue("=SUM(B54:BA54)");
回答1:
var text3 = result3.getResponseText();
var row = parseInt(text3);
activeSheet.getRange(row+3,55).setValue("=SUM(B" + row + ":BA" + row + ")");
using concatenation should work like you want it.
来源:https://stackoverflow.com/questions/47704060/spreadsheetapp-how-to-use-variable-inside-formula