I have a list of project numbers that is over 7000 rows long [example attached].
Many numbers are repeated. This list comes out of a financial reporting system.
I need to extract a list of unique numbers in numerical order.
I have two solutions working, one with SUMPRODUCT formulas and one with MACRO.
Here's the MACRO solution.
But it takes about 20 seconds to execute.
I am just looking to cut down on execution time. I am using this macro a few times on different lists in the same program.
Is there a better [faster] way to do this?
Sub UniqueOrder()
Sheets("Sheet1").Select
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
Application.EnableEvents = False
For i = LR To 2 Step -1
If WorksheetFunction.CountIf(Columns("A:A"), Cells(i, "A")) > 1 Then _
Rows(i).EntireRow.Delete Shift:=xlUp
Next i
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Thanks for any helpful hints.
modytrane
Bookmarks