I'm trying append some daily values to a sheet but can't quite figure out how to capture the current cell in a variable and then reuse it to generate the formula.
This is the code that I'm using
var emptyA = sheet.getRange(sheet.getLastRow()+1,1,1)
var emptyB = sheet.getRange(sheet.getLastRow()+1,2,1)
var emptyC = sheet.getRange(sheet.getLastRow()+1,3,1)
I'd like multiply the daily value in the A column with the value in cell F5 which also updates daily, because this changes it should be a formula so I figure it's something along the lines of
var dailyValue = sheet.getRange('F5')
var lastA = sheet.getRange(sheet.getLastRow(),2,1)
var formula = "=" + lastA + "*" + dailyValue
emptyB.setFormula([formula])
The problem that I'm having is lastA gives me "RANGE" rather than the cell ID
Does anyone have any thoughts?
Cheers, Rich