I have been worked on a VBA code for past couple of days and everything seems to be working fine till one fine day when I added the below code to it. It marco executed time increased to such an extent that I myself don't when it is going to complete. I have waited for almost 2 hours but it continues to run.
This datasheet that I have is about 15 MB in size and contains around 47,000 rows with 25 columns filled with data. I have running this code to delete rows basis the multiple criteria on Columns "H".
Here is the code. Any help to reduce the runtime is highly appreciated.
Thanks...
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Application.DisplayStatusBar = False
Workbooks("Vivar_Template_Blank.xlsx").Sheets("Main & PCO Working").Activate
Dim ws As Worksheet, i&, lastRow&, value$
Set ws = ActiveWorkbook.ActiveSheet
lastRow = ws.Range("H" & ws.Rows.Count).End(xlUp).Row
    For i = lastRow5 To 2 Step -1
    value = ws.Cells(i, 8).value
        If Not (value Like "*Supplier Name*" _
            Or value Like "*[PO]Supplier (Common Supplier)*" _
            Or value Like "*ACCENTURE LLP*" _
            Or value Like "*COGNIZANT TECHNOLOGY SOLUTIONS US CORP*" _
            Or value Like "*INFOSYS LIMITED*" _
            Or value Like "*INFOSYS TECHNOLOGIES LTD*" _
            Or value Like "*INTERNATIONAL BUSINESS MACHINES CORP DBA IBM CORP*" _
            Or value Like "*MINDTREE LIMITED*" _
            Or value Like "*SYNTEL INC*" _
            Or value Like "*TATA AMERICA INTERNATIONAL CORPORATION*") _
            Then
            ws.Rows(i).Delete
        End If
Next
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.DisplayStatusBar = True
    
Likepart I guess it would become more efficient, as the possible number of matches becomes smaller then.Likewith...