title: VBA for vlookup referencing previous spreadsheet
body: <p>I'm trying to set up VBA code that will create a new <code>vlookup</code> formula that references the previous spreadsheet whenever I create a new spreadsheet. Here's what I have so far:</p>
  
  <pre><code>Dim PS As Worksheet
  
  Set PS = ActiveSheet.Previous
  
  Range("L5").FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-2]," &amp; PS.Name &amp; "C[-2]:C[-1],2,FALSE),""N/A"")"
  </code></pre>
  
  <p>I've researched this quite a bit, but I've never seen anyone try to set a variable as <code>ActiveSheet.Previous</code>. In other solutions I've seen, it's always been a fixed sheet. </p>
  
  <p>Is this possible?</p>