title: FormulaR1C1 from another WorkBook
body: <p>I've been looking at this code for a while and can't seem to find what I'm doing wrong. It must be one of those obvious solutions, but I'm stumped.</p>
  
  <p>The line of code that's causing me trouble is this:</p>
  
  <p><code>Range("M2:M5759).FormulaR1C1 = "=if(isna(vlookup(RC[-12], " &amp; Path &amp; "[Budget " &amp; Month &amp; ".xlsx]Budget_" &amp; Month &amp; "'!RC[-12]:R[LastR]C[-12], 1, false)), ""NO"", ""YES"")"</code></p>
  
  <p>The variable Path contains the location of the file I'm looking at.</p>
  
  <p>The name of the file is Budget 0615.xlsx, and the Tab is named Budget_0615, but the date has to be changeable, so it is assigned to the variable Month.</p>
  
  <p>The variable LastR contains the number of rows in the file.</p>
  
  <p>My code is trying to return the value "NO" if the value in column A can't be found in the file Budget 0615.xlsx, and return "YES" if it can.</p>
  
  <p>When I run the Macro, I get the Run-time error '1004': Application-defined or object-defined error.</p>
  
  <p>Can someone help? If you need more info or if I'm not being clear, just ask.</p>
  
  <p>Thanks!</p>