title: Match shape colour to cell color - vba
body: <p>I am looking to set up a basic loop to set the color of each shape in the worksheet to match a corresponding cell in a table (conditional formatted).</p>
  
  <p>I have the following</p>
  
  <pre><code>dim countryShape as shape
  
  For Each countryShape In ActiveSheet.Shapes
  
  countryShape.Range.Interior.Color = Application.VLookup(countryShape.Name, ActiveSheet.Range("D3:H19"), 2, 0).Interior.Color
  
  Next countryShape
  </code></pre>
  
  <p>However, I get a </p>
  
  <blockquote>
    <p>run time error 424, 'Object required'</p>
  </blockquote>
  
  <p>I am guessing it is to do with the format of color application (i.e .interior.color for cells and .fill.forecolor for shape) however any combination I have tried so far is yet to work. </p>