B
B
bilokoniuk2019-01-13 16:49:56
Google Sheets
bilokoniuk, 2019-01-13 16:49:56

How to make a cell color change automatically depending on the user entering data into this cell?

There is a table which is allowed to be edited only by three users. It is necessary to make the cells edited by user 1 change color to blue, and user 2 to red, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Boev, 2019-07-02
@ProgrammerForever

Use these things:
onEdit(event) to determine if the table has changed
Session.getActiveUser().getEmail() - to determine the current user's email
event.source.getActiveRange() - to determine the current cell
setBackground() - to set the desired color

function onEdit(event){
  if (Session.getActiveUser().getEmail()=="[email protected]") event.source.getActiveRange().setBackground("#FF0000");
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question