Answers for "excel automatically change the fill color based on a hex value in the cell"

VBA
5

excel vba highlight cells using the hex color value within the cells

'VBA function to color cells in selected range based on the hex
'color number entered in each cell. For example, #FF69B4

Sub ColorCellsByHex()
    Dim r
    If TypeName(Selection) <> "Range" Then Exit Sub
    For Each r In Selection
        r.Interior.Color = Abs(("&H" & Mid(r, 6, 2) & Mid(r, 4, 2) & Mid(r, 2, 2)))
    Next
End Sub
Posted by: Guest on May-04-2020

Code answers related to "excel automatically change the fill color based on a hex value in the cell"

Code answers related to "VBA"

Browse Popular Code Answers by Language