|You do not need a macro for this, try:|
To select only Unique Records:
First, Select your range of cells, IE: A2:A9
Next, on the Data tab, in the Sort & Filter group, click Advanced.
In the Advanced Filter dialog box:
Select the Copy to another location button.
In the Copy to box , enter cell B2.
Check the Unique records only check box,
Now to get the number of Items, in cell C2 enter the formula:
The above formula is set to use rows A2 thru A9, as in your example, modify to suit your needs. Then drag down as many rows as necessary.
See how that works for you.
message edited by mmcconaghy