I have an Excel range with the 8 color constants. I just wanted to simply change the interior color of the cell in the adjacent column based on the cell value. Unfortunately, I get a type mismatch which is because it is treating the value as a string, but I don't know how to convert it to constant.
For example, to change interior color to blue this works rng.interior.color = vbblue
but not this rng.interior.color = rng.value 'because it is a string "vbblue"
What can I do to convert rng.value from string to the color constant so the range in column E gets background color based on value in column D?
Dim colorRange As Range
Dim rng As Range
Set colorRange = Range("D1", Range("D1").End(xlDown).Address)
For Each rng In colorRange
rng.Offset(, 1).Interior.Color = rng.Value
Next rng