Function TabSomme(ByVal LaFormule As Variant, ByVal Position As Integer) As Variant
Dim I As Integer
Dim MaValeur As Variant
MaValeur = Split(CStr(Range("A1").Formula), "+")(Position - 1)
For I = 1 To Len(MaValeur)
Select Case Mid(MaValeur, I, 1)
Case "="
Case "."
TabSomme = TabSomme & ","
Case Else
TabSomme = TabSomme & Mid(MaValeur, I, 1)
End Select
Next I
TabSomme = CDbl(TabSomme)
End Function
Function ValPosition(LaFormule, Position)
Dim Idr$
'--utilisation de l'adresse de la cellule de la formule
x = Split(LaFormule.Address, "$")(1)
x1 = Split(LaFormule.Address, "$")(2)
Idr = x & x1
'--split pour obtenir la valeur recherchée
MaValeur = Split(CStr(Range(Idr).Formula), "+")(Position - 1)
ValPosition = CDbl(Replace(MaValeur, "=", "")) '--pour éviter erreur sur position 1
End Function
Function NiemeTerme(x As Range, ByVal n&)
Dim t
t = Split(Replace((Replace(Replace(x.Formula, ",", "."), "=", "")), " ", ""), "+")
If n - 1 >= 0 And n - 1 <= UBound(t) Then NiemeTerme = Val(t(n - 1)) Else NiemeTerme = ""
End Function
Function TermeSomme(ByVal Cel As Range, ByVal N As Integer) As Double
TermeSomme = Application.Evaluate(Split(Cel.Formula, "+")(N - 1))
End Function
=TermeSomme(A1;B1)