In Excel, is there a way to set the background color of a cell from its RGB color code? For example, if cell A1 contains the hex value FF0000 (pure red) then I want the background color of that cell to be pure red.
Actually, this may be better in the Sheet Object Code Window...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Value = "" Then Exit Sub
If IsNumeric(.Value) Then _
.Interior.Color = .Value
End With
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.