title: Run excel formula through VBA
body: <p>I am trying to VLOOKUP some value in 2 sheets and if the value is found then i am putting a hyperlink on the Sheet 1 cell to point it to the Sheet 2 cell.</p>
  
  <p>I have written an Excel formula for the same and it is working fine. But I am unable to convert it into a VBA formula. What am I doing wrong?</p>
  
  <p>Excel formula:
      <code>=IF(ISERROR(VLOOKUP(RC[7],Sheet2!R1C1:R20C1,1,FALSE)),RC[7],HYPERLINK(CELL("address",INDEX(Sheet2!R1C1:R20C1,MATCH(RC[7],Sheet2!R1C1:R20C1,0))),RC[7]))</code></p>
  
  <p>VBA formula which i have tried:</p>
  
  <pre><code>Sheets(4).Formula = "= IF(ISERROR(VLOOKUP(RC[7],Sheet2!R4C2:R" &amp; Lrow2 &amp; "C2,1,FALSE)),RC[7],HYPERLINK(CELL(" &amp; """address""" &amp; ",INDEX(Sheet2!R4C2:" &amp; "R" &amp; Lrow2 &amp; "C2,MATCH(RC[7],Sheet2!R4C2:" &amp; "R" &amp; Lrow2 &amp; "C2,0))),RC[7]))"
  </code></pre>
  
  <p>P.S.: Do not worry about the row and column indexes. I wrote the formula for test file and writing the vba for the master file.</p>