Andonny,
This code should work:
Sub CountUnique()
' Data must be sorted in ascending order
' Change 2 to the first row of your data and 100 to your last
Dim ucount As Integer
ucount = 0
Dim rCol As Integer
' Change rCol to the column of data you want to analyze
rCol = 1
For x = 2 To 100
If Cells(x + 1, rCol).Value <> Cells(x, rCol).Value Then
ucount = ucount + 1
End If
Next x
r = MsgBox(ucount & " unique records in column " & rCol, , "Unique Count")
End Sub
-Ben
You could use Data|Filter|Advanced to filter the data to another location, and check the unique records box. The number of rows it takes is the number of unique records you have.
HTH
Richard
Since you don't want to count an item with a freq of occurrence > 1, use either:
=SUMPRODUCT((COUNTIF(range,range)=1)+0)
or:
=SUM((FREQUENCY(range,range)=1)+0)
If my interpretation above is not correct, that is, if you want to count "types", have a look at:
6187b.html
Aladin