View Single Post
 
Old 02-03-2017, 10:32 AM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

No wonder you let it run over night.

On my system, your code on that little dribble of data takes 1min 31 seconds leaving 16 rows.
Disabling screen updating reduces it to 4 seconds.

Using mickrickson's suggestion from post #4 at EF, adding your additional requirements, along with disabling screen updating takes less than 1 second.
Code:
Sub test()
    Dim i As Long
Application.ScreenUpdating = False
With ActiveSheet
For i = .Cells(Rows.Count, "C").End(xlUp).Row To 1 Step -1
    With .Rows(i)
        If .Range("P1").Value = "System Issues" Or .Range("P1").Value = "SME Floor Walker" _
                Or .Range("P1").Value = "Coaching" Or .Range("P1").Value = "Not Scheduled" _
                Or .Range("P1").Value = "Not Set Ready" Or .Range("P1").Value = "Available" _
                Or .Range("P1").Value = vbNullString Then
            If Not .Range("C1").Value Like "Agent:*" And Not .Range("C1").Value Like "Date:*" Then
                If Not .Range("M1").Value = "Break (Aux 2 - Agero Aux 4 - MG Break - Aux 71 HRB)" Then
                    .Delete
                End If
            End If
        End If
    End With
Next i
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote