I too couldn't get the function to work, but used the code as a macro instead
having the number is a cell. I was planning on using the cell as a refference in
a macro but this works just as well for me. What I needed it for was the macro I
have breaks out a different Excel file for each manager from the master file.
Now they want to know the status of the breakouts. ie "Current_File of
Unique_Count". I can get the rest of the data processed. I will be looking into
the best way to use a splash screen to update the users. If you have any
thoughts on this.
Sub Unique_Managers()
Dim unique As Object
Set Unique = CreateObject("Scripting.Dictionary")
EndOfData = Cells(Rows.Count, 1).End(xlUp).Row
' Populate dictionary
For Each vCell In Range(Cells(3, 1), Cells(EndOfData, 1))
If Not Unique.exists(vCell.Value) Then
Unique.Add vCell.Value, vCell.Value
End If
Next vCell
' Count unique items
Unique_Count = Unique.Count
' Clean up
Set Unique = Nothing
End Sub