Merci !!Bonjour KTM,
essayez avec :
A valider par Maj+Ctrl+Entrée car formule matricielle.VB:SOMME(SI(NB.SI($A$1:$A$30;A1:A30)=1;1;0))
Que signifie "compter sans doublons" ? Que doit on compter ?compter sans doublons
Function CompterStructure(Plage)
T = Plage
For i = 1 To UBound(T)
For j = i To UBound(T)
If T(i, 1) > T(j, 1) Then Buffer = T(i, 1): T(i, 1) = T(j, 1): T(j, 1) = Buffer
Next j
Next i
For i = UBound(T) To 2 Step -1
If T(i, 1) = T(i - 1, 1) Then T(i, 1) = ""
Next i
For i = 1 To UBound(T)
If T(i, 1) <> "" Then CompterStructure = CompterStructure + 1
Next i
End Function
SUPER !!!S'il faut compter les structures :
VB:Function CompterStructure(Plage) T = Plage For i = 1 To UBound(T) For j = i To UBound(T) If T(i, 1) > T(j, 1) Then Buffer = T(i, 1): T(i, 1) = T(j, 1): T(j, 1) = Buffer Next j Next i For i = UBound(T) To 2 Step -1 If T(i, 1) = T(i - 1, 1) Then T(i, 1) = "" Next i For i = 1 To UBound(T) If T(i, 1) <> "" Then CompterStructure = CompterStructure + 1 Next i End Function