Hi all,
I wanted to know is it possible to highlight the cell so that attention of the user gets on that cell?? I mean I already have lots of colored cells now, so can I have a cell which keeps on changing colors ?
I learned about conditional formatting, but that doesn't works for me, I want the cell to keep changing its color.
Just wondering is it possible or not??
Any kind of help would appreciated.
Thanks
Adam Martin
Solution:
If you change the value in Cell A1 then the following script will make Cell A1 to change the color Red and White, it will look as if it is blinking:
function onEdit(e)
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var mysheet = ss.getSheetByName("Sheet1");
var activeCell = ss.getActiveCell().getA1Notation();
if( activeCell == "A1" )
{
for(var i=0;i<50;i++)
{
if( i%2 == 0 )
mysheet.getRange("A1").setBackground("RED");
else
mysheet.getRange("A1").setBackground("WHITE");
SpreadsheetApp.flush();
Utilities.sleep(500);
}
}
}
Similarly we can script to function as per our conditions and as per our requirement.
NOTE: The above script will blink the Cell for 25 times as I have looped the code for 50 times, you can change it as per your requirement, but take care of the maximum time execution limit of Google Spreadsheet scripts.
And If you are not much familiar with scripts then check out the following link:
I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.
I also take up private or confidential projects:
If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html
Thanks,
Kishan,

0 komentar:
Posting Komentar