title: How to vlookup from another workbook selected through browser using VBA
body: <p>I am trying to use vlookup to get the data from a c1:c4,4 of the selected excel file by using vba. I want to get the data from the GL worksheet of selected workbook. Vlookup will first look for the value in the left of the active cell.</p>
  <p>Here is the solution I tried to make but it is not working. There is a problem with when referencing the file selected by browser in the formula.</p>
  <p>I would be appreciated your help.</p>
  <p>Thank you</p>
  <pre><code>Sub bdmachine()
  
  Dim filetoopen As Variant
  
  Dim openbook As Workbook
  
  
  filetoopen = Application.GetOpenFilename(Title:=&quot;Browse for the Breakdown that you want to turn into a lead sheet.&quot;, FileFilter:=&quot;Excel Files (*.xls*), *xls*&quot;)
  
  If filetoopen &lt;&gt; False Then
  
  With Selection
     
  Set openbook = Application.Workbooks.Open(filetoopen)
  
  .FormulaR1C1 = _
          &quot;=VLOOKUP(RC[-1], openbook.sheets(GL)!C1:C4,4,0)&quot;
         
  
     
  
  End With
  
  
  
  End If
  
  
  
  
  End Sub
  </code></pre>