I am trying to get a cell to blink when a file is opened. I currently have the following code that I have found from here, but don't know how to modify it to blink when the file is open. Can anyone help?

function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var mysheet = ss.getSheetByName("LBACC17"); var activeCell = ss.getActiveCell().getA1Notation();

if( activeCell == "K2" ) { for(var i=0;i<50;i++) { if( i%2 == 0 ) mysheet.getRange("K3").setBackground("RED"); else mysheet.getRange("K3").setBackground("WHITE");


} }

  • Welcome to Web Applications Stack Exchange. This request comes up every now and then. Google Apps Script runs on Google's servers, not in your computer, so this type of interactivity is not as practical as one might think. Consider using some way to draw a user's attention to a particular cell. If you require more help, please describe the end goal you are trying to solve by blinking a cell. Jan 2 at 4:28

1 Answer 1


To run code when a user opens the spreadsheet, use an onOpen(e) simple trigger.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.