We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9b81fce + 6ebd14e commit 091a4c1Copy full SHA for 091a4c1
triggers/triggers.gs
@@ -24,6 +24,23 @@ function onEdit(e) {
24
}
25
// [END apps_script_triggers_onedit]
26
27
+// [START apps_script_triggers_onselectionchange]
28
+/**
29
+ * The event handler triggered when the selection changes in the spreadsheet.
30
+ * @param {Event} e The onSelectionChange event.
31
+ */
32
+function onSelectionChange(e) {
33
+ // Set background to red if a single empty cell is selected.
34
+ var range = e.range;
35
+ if(range.getNumRows() == 1
36
+ && range.getNumColumns() == 1
37
+ && range.getCell(1, 1).getValue() == "") {
38
+ range.setBackground("red");
39
+ }
40
+}
41
+// [END apps_script_triggers_onselectionchange]
42
+
43
44
// [START apps_script_triggers_oninstall]
45
/**
46
* The event handler triggered when installing the add-on.
0 commit comments