Screenshot of cell colour change |
We make use of the 'onEdit(e)' trigger to achieve this task which takes an 'event object' - e - that is passed to the function so we can determine which cell has been edited. This means we do not require a separate project trigger to be created.
var cell = e.range;So from here we now have the active cell that was modified by the user allowing us to perform any number of tasks with it. In this instance we will be changing the background colour of the cell.
cell.setBackground('#faaf00');
Now once the user edits a cell it will change to a yellow colour.
Download
Change Google Sheet cell colour on edit download (please use 'File' > 'Make a copy' for your own version).
No comments:
Post a Comment