One of the most useful functions in Excel is a function that shows unique values from a range. There is a native UNIQUE function but it doesn't do the job very well and isn't supported by older Excel versions, so let me present an alternative.
Here is a VBA code for Unique-values function (it goes with alphabetical sorting here):
'-------------------------------------------------------------------------
' Source: risksir.com
' Description: Deleting dublicates and forming the unique-values array
'-------------------------------------------------------------------------
Function UniqValues(SourceRange As Variant) As Variant
On Error Resume Next: Dim cell As Range, coll As New Collection, txt\(
SourceArr = SourceRange
ArrSize = UBound(SourceArr, 1) * UBound(SourceArr, 2)
For Each cell In SourceRange.Cells
txt\) = Trim(cell): If Len(txt\() Then coll.Add txt\), txt$
Next cell
ReDim uniqarr(1 To ArrSize, 1 To 1)
For i = 1 To coll.Count: uniqarr(i, 1) = coll(i): Next i
For i = coll.Count + 1 To ArrSize
uniqarr(i, 1) = ""
Next i
UniqValues = SortABC(uniqarr, 1)
End Function