1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Function poids(champ, champcritere, critere, code)
Set mondico = CreateObject("scripting.dictionary")
a = champ
b = champcritere
For i = 1 To champ.Count
If b(i, 1) = critere And a(i, 1) <> "" Then
temp = a(i, 1)
mondico(temp) = mondico(temp) + 1
End If
Next i
tmp = code
poids = 1 / mondico.Item(tmp)
End Function
Function ItemsDifferentsCritere(champ, champcritere, critere)
Set mondico = CreateObject("scripting.dictionary")
a = champ
b = champcritere
For i = 1 To champ.Count
If b(i, 1) = critere And a(i, 1) <> "" Then
temp = a(i, 1)
mondico(temp) = mondico(temp) + 1
End If
Next i
ItemsDifferentsCritere = mondico.Count
End Function |
Partager