0

I would like to have a question for cells blinking in Google sheets. Here is my sample link:

https://docs.google.com/spreadsheets/d/18OgQIcSI9ey8B0yYXPI7BBf1kw8hvthlT8bPwn54vto/edit?usp=sharing

enter image description here

I have found this one on Internet and I would like to apply to my sheet. I would like my data validation when choosing the number, it will show like the above gif, it will blink to catch my eyes for these numbers.

Please kindly suggest me some scripts for this one. Thank you.

  • Related [Blinking cell in Google Sheets depending on cell content](https://webapps.stackexchange.com/q/106625/88163) – Rubén Oct 30 '20 at 16:56

1 Answers1

1

this should do it for you. lots of variations, but I think the 'sleep' method is what you're looking for.

while (test) {
sh.getRange('A3').setBackground("#FF0000");
sleep(1000); // 1 second delay
sh.getRange('A3').setBackground("#000000");
sleep(1000); // 1 second delay
}
Jason Torpy
  • 124
  • 14
  • This will throw a exeeceded time exectution limit error after 6 / 30 mins – Rubén Oct 30 '20 at 16:54
  • Hi Jason, is there a way to run this script as I haven't find the way to apply it? Thank you. – Hai Anh Nguyen Oct 31 '20 at 04:05
  • @HaiAnhNguyen I'm not sure I understand your question. this is not a full function though, just an isolated while loop that does what you want. As Ruben noted, you can't just let this run forever. presumably you'll only run this for a few seconds until the user sees it and then it will stop. – Jason Torpy Oct 31 '20 at 17:06
  • Hi Jason, it would be great if you could share with me the full script for the column with data validation I would like to make it blink. Thank you. – Hai Anh Nguyen Nov 02 '20 at 02:32
  • function onEdit() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; var range = sheet.getRange(3,3); var val = range.getValue(); for (var i=0;i<5;i++){ range.setValue(''); SpreadsheetApp.flush(); range.setValue(val); SpreadsheetApp.flush(); } } I have also found this script and I would like to apply to the column with data validation. Could you please suggest me on that? I have tried the one I have just found and changed a little bit but it has edited the column with the same number I have added in the 1st row. Thank you for assisting me. – Hai Anh Nguyen Nov 02 '20 at 02:41
  • The script I gave you doesn't change. The value of 'test' might change. Like test=range.getValue()>5; or just test=range.getValue() if your validation is true or false. If the range just has any sort of data validation, that's easy enough. It depends on what you want. – Jason Torpy Nov 02 '20 at 14:36