I'm looking to optimize my for loop to search faster. I've turned off ScreenUpdating, EnableEvents, Calculation, and DisplayStatusBar to speed it up a litte. I have about 10,000 rows to search for in the FAR tab. It works by reading the FAR tab rows and if it matches the master account list (Account_Range) located in the Input tab, it won't delete the row. It will then update the rows (not shown above). I ran this and it took exactly an hour to run. Sub DeleteRowsWithArray()Dim dontDelete() As VariantDim actRange As rangeSet actRange = Sheets(Input).range(Account_Range)dontDelete = actRangeDim i As Long, j As LongDim isThere As BooleanSheets(FAR).SelectFor i = Cells(Rows.Count, B).End(xlUp).Row To 3 Step -1    For j = LBound(dontDelete) To UBound(dontDelete)        If StrComp(range(B & i), dontDelete(j, 1), vbTextCompare) = 0 Then            isThere = True        End If    Next j    If Not isThere Then        range(B & i).Delete shift:=xlUp    End If        isThere = FalseNext iEnd Sub
Delete unmatched rows in Excel
vba;excel;time limit exceeded