Reputation: 21
I am trying to change tab color depends if TabName is on a RANG table or Cell Value.
Thanks u so much!
Trying to Change TabColor.
Upvotes: 1
Views: 51
Reputation: 21
This Code is awesome but need check all sheets and load J1 cell automatically:
function onEdit(e) {
if (e.range.getA1Notation() != "J1") return;
var sheet = e.source.getActiveSheet();
if (e.value == '0' || !e.value) sheet.setTabColor(undefined);
if (e.value == '1') sheet.setTabColor('red');
if (e.value == '2') sheet.setTabColor('blue');
}
Upvotes: 1