Sub ColorCellsByHexInCells() Dim rSelection As Range, rCell As Range If TypeName(Selection) = "Range" Then Set rSelection = Selection For Each rCell In rSelection rCell.Interior.Color = WorksheetFunction.Hex2Dec(Mid$(rCell.Text, 2)) Next End If End Sub
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter