Google Apps script - change the background color of a cell with a hex value from another cell -



Google Apps script - change the background color of a cell with a hex value from another cell -

i'm trying alter background color of cell hex value cell. example, i'd create cell in a2 have background color of #333333 (which text value of cell a1). here code have far:

function setcolor(targetcell) { // targetcell's value (a hex value) // set background of active cell value of targetcell var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheets()[0]; var value = ss.getrange(targetcell).getvalue(); var cell = sheet.getactivecell().setbackground(value); homecoming cell; };

right code not run because getrange(targetcell) not correct, when replace targetcell "a1", error message "you not have permission phone call setbackground (line 9)"

in short, custom function can't modify other cells,

please refer documentation custom function see limitations.

google-apps-script google-drive-sdk google-apps

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -