Reputation: 289
Data:
The formula will check if B1 >= F3 the resul will Call if not In Time.
As you see in this example right now is 15:45 and the G3 will show "In Time" but when the =googleclock function mark 28/11/2013 16:00:00, G3 will change the value to Call. In that moment the background should be change from gree to Red-
I have a formula in the Column G, the result of that formula "Call" or "In Time".
I set a conditional formatting using Menu > Format > Conditional Formatting to Column G. but the conditional only work for the existing rows.
If I add new rows the Conditional Formatting is not set to that news rows.
Once solution is create a script that detect the value in the cell, and if the Value is Call turn backgroundcolor to Red and if In Time turn to green.
If I set this script to run in OnEdit or Run every 5min or Min the system will turn slow because this script will check the value every time.
Does exist any way to set conditional formatting like as I set from menu?
Upvotes: 2
Views: 3679
Reputation: 45710
Range.copyTo() can copy conditional formatting.
For example, this snippet will copy the conditional formatting from cell A1
to the rest of the column:
function copyFormat() {
var source = ss.getRange('A1');
var destination = ss.getRange('A2:A');
source.copyTo(destination, {formatOnly:true});
}
Upvotes: 3