title: Change interior color based on cell value of color constant
body: <p>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.</p>
  
  <p>For example, to change interior color to blue this works
  rng.interior.color = vbblue</p>
  
  <p>but not this
  rng.interior.color = rng.value 'because it is a string "vbblue"</p>
  
  <p>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?</p>
  
  <p><a href="https://i.stack.imgur.com/1eI1j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1eI1j.png" alt="range"></a></p>
  
  <pre><code>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
  </code></pre>