0

This is my apps script function which is essentially trying to reverse sheets' FORMULATEXT:

function textFormula(formula) {
  var sheet = SpreadsheetApp.getActiveSheet();
  var cell = sheet.getActiveCell();
  cell.setFormula(formula);
}

This is how I'm calling it in a cell in Sheets: enter image description here

And this is the error I'm getting: enter image description here

From what I gathered, I should be able to use my custom function to affect the calling cell? Idk, lost.

Bmr
  • 23
  • 4

1 Answers1

0

The only way a custom function can change the values in the spreadsheet is by returning values. You cannot use any of the various .set methods in a custom function, and thus cannot modify formulas.

doubleunary
  • 13,842
  • 3
  • 18
  • 51