title: VBA vlookup with defined range and file from other workbook
body: <p>I'm working in the workbook "File". Then, I open another workbook (Masterfile) which is used to look up data.</p>
  
  <pre><code>Workbooks.Open FileName:=Path &amp; Masterfile
  
  lRowMasterfile = Cells(Rows.Count, "A").End(xlUp).Row
  SelectionMasterfile = Range("A1").CurrentRegion.Address
  
  Workbooks(File).Activate
  
  Range("K2").FormulaR1C1 = "=VLOOKUP(RC[-1],'" &amp; Masterfile"' &amp; ! &amp; SelectionMasterfile,1, FALSE)"
  
  Range("K2").AutoFill Destination:=Range("K2:K" &amp; lRowFile)
  
  Workbooks(Masterfile).Close
  </code></pre>
  
  <p>I define Masterfile and Range to use it in other documents but unfortunately it does not work. Can anybody help?</p>