title: How to convert cell vlookup to VBA
body: <p>Currently, I am having a formula in my cell:</p>
  
  <pre><code>=IFERROR(VLOOKUP(A:A,'Daily Report'!A:Z,2,FALSE),"")
  
  =IFERROR(VLOOKUP(A:A,'Daily Report'!A:Y,7,FALSE)&amp;", "&amp;VLOOKUP(A:A,'Daily Report'!A:Y,8,FALSE)&amp;", #"&amp;VLOOKUP(A:A,'Daily Report'!A:Y,9,FALSE)&amp;"-"&amp;VLOOKUP(A:A,'Daily Report'!A:Y,10,FALSE)&amp;", Singapore "&amp;VLOOKUP(A:A,'Daily Report'!A:Y,11,FALSE),"")
  </code></pre>
  
  <p>How do I convert it to VBA so the entire column will be encrypted with this formula?</p>
  
  <p>My formula is always replaced by the guys using my excel sheet. </p>
  
  <p>I am avoiding locking  the cell, hence looking at VBA to perform this action. </p>
  
  <p>Edited: </p>
  
  <p><strong>MACRO</strong></p>
  
  <pre><code>Sub vlookup()
  Dim LR As Long
  LR = Cells(Rows.Count, "A").End(xlUp).Row
      Range("D2").Select
      ActiveCell.FormulaR1C1 = _
          "=IFERROR(VLOOKUP(C[-3],'Daily Report'!C[-3]:C[22],2,FALSE),"""")"
      Selection.AutoFill Destination:=Range("D2:D" &amp; LR), Type:=xlFillDefault
  End Sub
  </code></pre>
  
  <p>Now how to make data e.g. 09-02-18022013-03383-A when enter to column A, it will run the macro to input the rightful data.</p>