title: Get a background color with VBA Excel function
body: <p>The formula should return the background color of a cell pointed as argument. For example <code>=BackGroundColor(C3)</code> should return background color of cell <code>C3</code>. </p>
  
  <pre><code>Public Function BackGroundColor(rng As Range)
      BackGroundColor = rng.DisplayFormat.Interior.Color
  End Function
  </code></pre>
  
  <p>Tried different alternatives with <code>rng.Address</code> etc. Neither of them worked. Can you please suggest what I am doing wrong?</p>