I am working on a simple tracking tool for products with google Sheets. The top row has components ranging from 1 to 13 for a product. When all the components are checked as arrived the row automatically changes the Ready status in column R to ready. The grey areas are to determine which components do not belong to certain products.
Here is the document. https://docs.google.com/spreadsheets/d/18iX6Yp8SgfPaDRJC8L6f4xU1U9Gw8eiBINNFPT9r0Ow/edit?usp=sharing
This works ok, however I would like to have a timestamp to appear once the Ready status changes.
I found a piece of code and edited it to almost suit my needs.
function onEdit(event) {
var eventRange = event.range;
if (eventRange.getColumn() == 18) { // 18 == column R
var columnARange = SpreadsheetApp.getActiveSheet().getRange(eventRange.getRow(), 19,eventRange.getNumRows(), 19); // 19 == column S
var values = columnARange.getValues();
for (var i = 0; i < values.length; i++) {
values[i][0] = new Date();
}
columnARange.setValues(values);
}
}
The problems is since it is an OnEdit function I have to manually edit the range specified if I want the timestamp to appear. In the example I linked above the "1"s in the R-column produce the timestamp but the formula that changes the cell to "Ready" once all empty boxes are crossed out, does not.
Is there any way to edit the function to look at the the sheet and if the word "Ready" is found in the R-column, a time stamp would apear next to it in the S-column?
This forum has helped me many times already and for that I thank everyone contributing.
UPDATE
I found this piece of code here https://productforums.google.com/forum/#!topic/docs/3Iz9y9OSLMk
function emailSendingTrigger() {
var sheet = SpreadsheetApp.getActiveSheet();
if (sheet.getName() == "Sheet Name") {
var activeCell = sheet.getRange("F21");
if (activeCell.getValue() <500) {
emailBALANCETE();
}
}
}
Could it be changed so that it looks at each cell in a range and triggers a timestamp if the cell value changes to "ready"?
Something like
For each cell in range
If value "Ready"
Offset.1 select.cell
set.value New Date()
Now I know that is definitely not correct but maybe gives some insight as to what I am going for.
Totti