Reputation: 11
I have multiple people that is reviewing data in google sheets and they might need to make changes to a cell. Is there a way to automatically highlight a cell when someone makes a change? I don't need to know who made it, just that the cell has changed, compared to a certain point in time. Thanks!
Upvotes: 1
Views: 5790
Reputation: 31
I found this code and modified for myself sow whenever anybody makes a change to any cell it will highlight in yellow. Then you can write a script that reset all the colors once per day, week, month depending on sheet activity.
function onEdit() {
var sheetsToWatch = ['Sheet1', 'Sheet2', 'Sheet3', 'Sheet4', 'Sheet5', 'etc.'];
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var cell = sheet.getActiveCell();
var sheetName = sheet.getName();
var matchFound = false;
for (var i = 0; i < sheetsToWatch.length; i++) {
if (sheetName.match(sheetsToWatch[i])) matchFound = true;
}
if (!matchFound) return;
var rowColLabel =
sheet.getRange(cell.getRow(),cell.getColumn()).setBackground('#faec15'); // #faec15
// set backgorund color in yellow,
// you can do any color
}
Upvotes: 3
Reputation: 38346
Use on edit (simple or installable) or the on change triggers to run a function that change the cell formatting, like applying a color to the cell background.
References
Upvotes: 0