0
votes

Am trying to set formula for a cell in goole spreadsheet using apps script....

Everything going fine until am working in same work sheet, but i have tried to update a cell using another worksheet from the same spreadsheet as follows,

sheet.getRange(1,1,1,1).setValue("=Ref!A15");

but it shows error:Unknown range name Ref!A15

i dont know what am missing here, can anyone please help me to solve this issue...

Thanks in Advance...

1

1 Answers

1
votes

You are getting this error because it is trying to find a named range and failing. Instead, use: sheet.getRange(1,1,1,1).setFormula("=Ref!A15"); to set a formula for a cell.