title: excel vba: insert formula with dynamic cell reference using vba?
body: <p>I am inserting the following hyperlink as a formula using vba:</p>
  
  <pre><code>ActiveSheet.Range("AD" &amp; ActiveCell.Row).Formula = "=HYPERLINK(""S:\Tasks\" &amp; Range("C" &amp; ActiveCell.Row).Value &amp; "\log.txt"",""View Log"")"
  </code></pre>
  
  <p>This works fine, however if my value in cell C was to change then my hyperlink becomes invalid and won't work because it has retained the value of the cell at the time in which the formula was entered.</p>
  
  <p>I need a way of making a dynamic reference to my cell C in the event that the value should change then my link will also change.</p>
  
  <p>Can someone please show me how to do this? Thanks in advance</p>