title: VBA-Change color of cells based on value in particular cell
body: <p>I want to change the background colors of cells <code>A2:C2</code> based on the value of cell <code>D2</code>.</p>
  
  <p>This also applies to the relative cells in rows 3,4, and 5. </p>
  
  <p>If the value in cell <code>D#</code> is 1, I'd like color x. If the value is 2, I'd like color y, if the value is 3, I'd like the color z.</p>
  
  <p>If it makes a difference, the target range (<code>A2:D6</code>) will be in a table format.</p>
  
  <p>I'd like this subroutine to execute upon opening the workbook. I know where to put that subroutine so don't sweat instructing me how.</p>
  
  <p>I've done this with conditional formatting, but it'd be nice to have some VBA I can copy-pasta into future reports. </p>