title: Passing cell reference into VBA formula as argument
body: <p>I am having an issue that I am not able to sort it out. I need to pass a cell reference as an argument in a function.</p>
  <p><code>   Dim WshtRD As Worksheet</code></p>
  <pre><code>Dim DI As Date
  Dim RngDI As Range
  Set WshtRD = ActiveSheet
  AI = DateValue(Range(&quot;O3&quot;))
  With WshtRD
  Set RngDI = .Range(&quot;A:A&quot;).find(What:=Format(AI, &quot;dd/mm/yyyy&quot;), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)      
  End With`
  
  
  Range(RngDI.Offset(columnOffset:=3), &quot;D2&quot;).Select
      
      
  Range(&quot;Q10&quot;).Formula = &quot;=AVERAGE()&quot;`
  </code></pre>
  <p>What I would like to do is set this range</p>
  <pre><code>Range(RngDI.Offset(columnOffset:=3), &quot;D2&quot;).Select
  </code></pre>
  <p>as an argument for the AVG function.</p>
  <p>Can someone help me? Thanks!</p>