''' AU CHOIX '''
'### Fonction matricielle (retourne un tableau dans un Variant) ###
Function zaza(Cellule As Range) As Variant
Dim var
Dim i&
Dim x#
Dim cpt&
Dim T(1 To 3)
'---
var = Split(Cellule, "-")
For i& = LBound(var) To UBound(var)
If IsNumeric(var(i&)) Then
x# = x# + var(i&)
cpt& = cpt& + 1
End If
Next i&
T(1) = x#
T(2) = cpt&
T(3) = x# / cpt&
zaza = T
End Function
'### Fonction simple (retourne un numérique dans un Double) ###
Function toto(Cellule As Range, Total_Nombre_Moyenne) As Double
Dim var
Dim i&
Dim x#
Dim cpt&
Dim T(1 To 3)
'---
var = Split(Cellule, "-")
For i& = LBound(var) To UBound(var)
If IsNumeric(var(i&)) Then
x# = x# + var(i&)
cpt& = cpt& + 1
End If
Next i&
T(1) = x#
T(2) = cpt&
T(3) = x# / cpt&
toto = T(Total_Nombre_Moyenne)
End Function