title: Excel VBA Vlookup with Ranges
body: <p>I have vlookup formula that takes the value of A2 and returns the corresponding match found in my Lookup_Table in cell O2, this lookup continues for the rows underneath.</p>
  
  <p>How would I modify this code to lookup a range of values in A:M, with the results placed in O:AA? Or do I have to manually code each column separately?</p>
  
  <pre><code>  With Sheets("Example")
      .Range("O2:O" &amp; .Range("A" &amp; Rows.Count).End(xlUp).Row).Formula = _
          "=IF(ISERROR(VLOOKUP(A2,'Lookup_Table'!A:H,4,FALSE)),0,VLOOKUP(A2,'Lookup_Table'!A:H,4,FALSE))"
             .Range("O2:O" &amp; .Range("A" &amp; Rows.Count).End(xlUp).Row).Value = _
          .Range("O2:O" &amp; .Range("A" &amp; Rows.Count).End(xlUp).Row).Value 'Comment out if you'd like to leave the above formula in place
  End With
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4qOJT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4qOJT.jpg" alt="screenshot"></a></p>