title: Looping around VLOOKUP to delete row on success
body: <p>I am trying loop back over data in a worksheet in Excel 365 and when certain conditions are met, delete the row the condition applies to. All is well until I use the workbook VLookUp function as a part of the final condition - I need to delete the row if any of the conditions are true or if the VLookup is successful (an error in the VLookUp would mean that the row should be kept). What I currently have is:</p>
  
  <pre><code>On Error Resume Next
  divFile = "C:\....\workbook.xlsx"
  Set divWorkbook = Workbooks.Open(divFile)
  Set divRange = divWorkbook.Worksheets("Sheet3").Range("B2:B274")
  
  For i = lastRow To firstDataRow Step -1
      If Condition1 Or _
         Condition2 Or _
         WorksheetFunction.VLookup(Cells(i, lcCol).Value, divRange, 1, False) Then
          If Err.Number = 0 Then
              Rows(i).Delete
          End If
     End If
  Next i
  </code></pre>
  
  <p>The above flips to the other workbook (divWorkbook) and does not do what is intended. How would I keep focus on the current workbook and sheet and apply the delete when the vlookup is successful but not when it isn't?</p>
  
  <p>Thanks,
  Ben</p>