Vote utilisateur: 1 / 5

Etoiles activesEtoiles inactivesEtoiles inactivesEtoiles inactivesEtoiles inactives

With Excel, I had always found that there was a crual leak with functions : no count distinct !

A simple user function could help to fill the gap.


Here is the code :

Function NbValUniques(laPlage As Range)
Dim ValeursUniques As New Collection
On Error Resume Next
For Each cell In laPlage
ValeursUniques.Add cell.Value, CStr(cell.Value)
Next cell
On Error GoTo 0
NbValUniques = ValeursUniques.Count
End Function

You just have to call the function like any other function from a cell and define the range that you would like to count :


Commentaire (0) Clics: 7486