title: application.match returns a value where one does not exist
body: <p>I am not great at this yet, but I am trying to do this without copy-pasting code... not sure its the best idea.</p>
  
  <p>I am trying to search for to different values in two columns and then return a different if both columns match.  In the end I will be pulling from about 9 different workbooks.</p>
  
  <pre><code>Dim wbACF As Workbook
  Dim wsDiv As Worksheet
  Dim rng As Range
  Dim WC As String
  Dim vCELL As Variant
  Dim switch As Variant
  Dim nvCell As Variant
  Dim lastCell As Variant
  Set wbACF = Workbooks("ACF.xls")
  WC = Sheet1.Cells(5, 14).Value
  nvCell = "A1"
  lastCell = "A999"
  Set wsDiv = wbACF.Worksheets(WC)
  Set rng = wsDiv.Range(nvCell, lastCell)
  switch = 1
  Do While switch = 1
      vCELL = Application.Match("test", rng, 0)
      If wsDiv.Cells(vCELL, 7).Value = Sheet1.Cells(5, 13).Value Then
          Sheet1.Cells(11, 1).Value = wsDiv.Cells(vCELL, 4)
          switch = 0
      Else
          nvCell = "A" &amp; vCELL + 1
          Set rng = wsDiv.Range(nvCell, lastCell)
      End If
  Loop
  </code></pre>
  
  <p>for my test files, rows 10, 70, 150 and 210 match for test, but only row 210 match for both test and Sheet1.Cells(5, 13).Value</p>
  
  <p>vCELL becomes 10 in the first loop, and then executes the else portion, on the second loop vCELL becomes 60 and then never changes.  I am sure my coding is poor, and is a contributing factor, but any help would be appriciated.</p>