The sort seems a bit over the top, since it will have to comapre all the values at least once anyway.
Just do a nested loop. For example...
- Dim I As Long, J As Long
-
For I = 1 To SizeOfArray - 1
-
For J = I + 1 To SizeOfArray
-
If Array(I) = Array(J) Then
-
DuplicateFlag = True
-
Exit For
-
End If
-
Next
-
If DuplicateFlag Then Exit For
-
Next
-
This is just off the top of my head, don't take it as Gospel. :)