4

I created an onEdit() trigger in Google App Script, but it only works when I change the value of a cell; not when I change the background color. How can I fix it?

Alan Wells
  • 30,746
  • 15
  • 104
  • 152
Daniele
  • 359
  • 7
  • 15

1 Answers1

3

NOTE: There is an open issue about onChange(e) to report that it's not working. See Google script onChange event doens't fire anymore


Instead of using onEdit(e) use onChange(e). When the background of a cell be changed, the value of e.changeType will be FORMAT.

function onChange(e) {
   // Show a popup with a message showing the type of change.
   SpreadsheetApp.getActiveSpreadsheet().toast(e.changeType);
}

References

Rubén
  • 34,714
  • 9
  • 70
  • 166