I'm trying to make a script that automatically change the background color of cells depending on which user edits it. I currently have this code but it doesn't do anything. We need to know which user edits or creates a new entry.
I just need the cells in the first column to change background color. This is for a Data base I'm working with 4 other people
function checkEdits() { var s = SpreadsheetApp.getActiveSheet(); //checks that we're on the correct sheet if (s.getName() == "Sheet1") { var r = s.getActiveCell(); //checks the column if (r.getColumn() == 1) { var email = r.Session.getActiveUser().getEmail(); if (email == "[email protected]") { r.setBackground('#dbbf94'); } if (mail == "[email protected]") { r.setBackground('#94dbab'); } if (mail == "[email protected]") { r.setBackground('#a2bfdf'); } if (mail == "[email protected]") { r.setBackground('#cf9ce5'); } if (mail == "[email protected]") { r.setBackground('#dfa2b1'); } } } } I expect that when a user edit a cell un Column A, the same cell changes its background to the specific user color