Forum Discussion
Beth ten Have
May 11, 2020Copper Contributor
Add Cell Fill Colour Based on Hex or RGB
Is it possible to fill a cell with a colour based on either the hex code or the RGB values of that colour (they would be in neighbouring cells in the same row) without using VBA?
- Aug 02, 2023
Beth ten Have I just figured out a solution here for those still scratching their heads.
Make a table with:
- Column A: Insert your hex codes and name the column "HEX"
- Column B: Name this column "LINK" and use formula:
- {="https://www.colorhexa.com/
- Make sure to remove the braces before and after the above formula
- {="https://www.colorhexa.com/
- Column C: Use formula {=image(@[LINK])}
voila
flooor
Sep 01, 2026Copper Contributor
Not sure what this post looks like to others, but in my browser I seem to be missing some parts in CVWISMO's reply (specifically the URL formula) and had to figure out the rest. This is how I got this to work in my Office365 version of excel today:
- Column A = named "HEX", containing hex code (without #)
- Column B = named "SWATCH" containing formula:
=IMAGE([@LINK];;1)
- Column C = named "LINK" containing formula:
- =HYPERLINK("https://www.colorhexa.com/"&[@HEX]&".png")
Had to include .png extension. Wanted my swatch directly next to the code and thus switched around columns B and C compared to the previous reply.
Hope that helps anyone looking for this solution a few years later!