title: How to avoid ActiveCell in a UDF
body: <p>In Excel, I have user-defined functions whose results depends on what cell they are in. One uses this line:</p>
  <pre><code>cel = Range(&quot;O&quot; &amp; ActiveCell.Row).value
  </code></pre>
  <p>and another includes:</p>
  <pre><code>CY = ActiveCell.EntireColumn.Cells(3).Value
  </code></pre>
  <p>I suspect that <code>ActiveCell</code> is causing problems (such as cells containing the UDFs spontaneously changing to the wrong answer).</p>
  <p>I would think that relative references (like &quot;R4C[0]&quot;) would work, but I'm not sure how to do that in code.</p>
  <p>Is there another way to refer to Column &quot;O&quot; of the current row or Row 3 of the current column?</p>