Mar 04 2019 06:19 AM
Hi,
I need to colour a cell with a color calculated from its RGB components or defined by its hexadecimal code.
Simple conditional formatting seems not to be usable for that, as it allows only a choice between a limited number of predefined colors.
I haven't seen any information on this anywhere.
Is it possible and how could I make it?
I'm using Excel for Mac 2011 version 14.7.0 on a MacBookPro under macOS High Sierra 10.13.6, but I think/hope that my question is a generic one and not dependant on the environment.
Thanks in advance for any help on this issue.
Gerard
--
Mar 04 2019 08:02 AM
SolutionMar 04 2019 08:54 AM
@Rich99 wrote:
Hi, Have a look at this web page, seems to have what your looking for, https://stackoverflow.com/questions/1426369/excel-set-background-colour-of-cell-to-rgb-value-of-data...
Great Rich99 , thanks a lot, this link seems to fit exactly what I want to do.
My understanding is that this Web page proposes two different methods, one based on VBA, the other one based on Macros.
I am not familiar with any of them but I will try and learn!
Do you have any advice about which one to try first?
Best,
Gerard
--
Mar 04 2019 10:25 AM
Good news:
My tests are going very well: I have been able to run successfully the Excel Macro:
BUT one has to be very cautious with the input data as (at least with my version) Excel processes the colour value as "BGR" as explained in the code, and not "RGB" as I was expecting!
The Cell content has to be: (Blue*256+Green)*256+Red to get the right colour!!!
Gerard
--
Mar 04 2019 08:02 AM
Solution