0

The row in my spreadsheet has format

<value>, <formula>, <value>, <formula>, ...

I need to update this row. Indeed, I can't use range.setFormulas, because it has values and I can't use range.setValues, because it has formulas. The only way I found - to set by one value, but this is very expensive if I have a lot of cols in my sheet.

Is there any way to set both formulas and values in one network request?

PS. To set value via setFormula('"' + str + '"') is not very good idea

  • Why is setFormula('"' + str + '"') not a very good idea? Do you want to edit formulas with your script? If not why not just put the values all next to each other and the formulas on the end? – CodeCamper Dec 15 '19 at 1:11
0

I can't use range.setFormulas, because it has values and I can't use range.setValues, because it has formulas

Wrong, just use setValues and if it is a formula add an equal sign to the beginning...

https://developers.google.com/apps-script/reference/spreadsheet/range#setvaluevalue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.