title: Setting the table_array in a VLOOKUP in VBA excel
body: <p>I am trying vlookup in VBA. I am referencing to another sheet within the same workbook but i am getting <code>#NAME?</code> as a result. </p>
  
  <pre><code>Sub MatchNames()
  
  l_row = Worksheets("Lookup").Cells(Rows.Count, 1).End(xlUp).Row
  lookup_range = Worksheets("Lookup").Range("A2:E" &amp; l_row)
  
  Final_row = Cells(Rows.Count, 6).End(xlUp).Row
  
      With Range("BG2:BG" &amp; Final_row)
          .FormulaR1C1 = "=vlookup(RC[-52],lookup_range, 2, False)"
  
      End With
  
  End Sub
  </code></pre>