# RGB values in Calc

In a LibreOffice Calc sheet I have entered manually some numbers (RGB values), each value in a different cell, horizontally.

What I need is: What formula should I type/use in order to get an actual colored cell with the RGB values type in the previous cells?

Thank you! C:\fakepath\rgb-cells.ods

edit retag close merge delete

From my point of view there is no such formula and you even cannot write your own function (!!!) to achieve your goal, since as far as I understand functions are not allowed to change the sheet from where they are called (see also answer from Andrew at https://stackoverflow.com/questions/12089051/changing-cell-background-color-in-libreoffice)

( 2019-04-27 13:43:22 +0100 )edit

Thank you @Opaque. I also found a topic after posting my question, but I do not know where and how to put the code suggested by arindam in this topic I mentioned: https://ask.libreoffice.org/en/questi...

( 2019-04-27 13:48:26 +0100 )edit

Hello - check out for Tools -> Macros -> Edit Macros - that's the place, where these subroutines (and functions) go to and afterwards you may assign it to some toolbar or you create a simple button within your sheet.

( 2019-04-27 13:57:34 +0100 )edit

For a long time now the restrictions concerning side-effects of user functions were weakened. You can set the .String and the .Value property, and also .Formula e.g.
However, the setting of many other properties is still prohibited (without throwing an error) and I don't know any specification insofar. We have to expect changes without notice, and should therefore not rely on side-effects afflicting cells in the same sheet from where the user function was called.

( 2019-04-27 16:34:54 +0100 )edit