Hi, the below code is taking forever to run, the worksheet has no formulas, so dont know why its running so slow, i do have 3 other worksheets in the workbook, in which one of those worksheets which does have formulas, should this be the reason?
Is there anything i can do to make it run faster?
Is there anything i can do to make it run faster?
Code:
Sub Delete_Dupes()
Dim rw1 As Long: rw1 = 1
Dim rwx As Long: rwx = rw1
Dim stepx As Integer
Dim co1 As Integer: co1 = 3
Dim bool As Boolean
Application.ScreenUpdating = False
Do Until Cells(rwx, co1) = ""
stepx = 1
If rwx > rw1 Then
On Error GoTo NewCrit
bool = IsError(Application.WorksheetFunction.Match(Cells(rwx, co1), Range(Cells(rw1, co1), Cells(rwx - 1, co1)), 0))
Select Case bool
Case True
'no match found thus row = first instance (no delete)
Case False
'match found in prior rows therefore duplicate so delete
Rows(rwx).Delete
stepx = 0
End Select
End If
rwx = rwx + stepx
Loop
Exit Sub
NewCrit:
bool = True
Resume Next
Application.ScreenUpdating = True
End Sub