I'm trying to use a function to get the hexadecimal code of the cell background and concatenate it with the text contained in the same cell.
i.e. in sht1.cell(A1)
I type "Hello" with red background, I would have in sht2.cell(A1)
the following text: "[#FF0000]Hello"
I was trying this:
function getHexValue(range) {
return SpreadsheetApp.getActiveSheet().getRange(range).getBackground();
}
but it doesn't always work, especially if I share the file. I tried to setup some triggers using edit, change or open events but id keeps not updating this is what i tried to do.
Any suggestion?
If I type: =gethexvalue("A5")
I get the color code, if I type the formula to another cell or another sheet and I update the values or reload the sheet it doesn't work.