title: VBA Vlookup across multiple sheets
body: <p>So I have two lists, each one in a different sheet. I'm checking that values in Sheet B are also in Sheet A. I'm using VLookup for this, the problem seems to be with the range statements, as this range appears to be 'empty'.</p>
  
  <p>My VBA attempt is something like, </p>
  
  <pre><code>Dim lookupVal As String
  Dim myString As String
  
  For i = 1 to N
      lookupVal = Sheets("b").Cells(1 + i, 2)
      myString = Application.WorksheetFunction.VLookup(lookupVal, Sheets("a").range(Sheets("a").Cells(9,3), Sheets("a").Cells(N+8, 3)), 1, False)
      If IsEmpty(myString) Then
          Sheets("b").Cells(1+i, 3) = ""
      Else
          Sheets("b").Cells(1+i, 3) = myString
      End if
  
  Next i
  </code></pre>
  
  <p>I get 'Run-time 1004: Application-defined or object-defined error'. Any help appreciated.</p>