There are (of course) other ways this could be done with VBA.
Public Function CountDistinct(rng As Range) As Long
Dim i As Long
Dim Cnt As Double
Cnt = 0
For i = 1 To rng.Rows.Count
Cnt = Cnt + 1 / WorksheetFunction.CountIf(rng, rng(i, 1))
Next i
CountDistinct = CLng(Cnt)
End Function