Bonjour à tous,
Une alternative avec une fonction personnalisée :
Function SommeLettres(chaine$) As Double
Dim reg As Object, subdiv As Object
Set reg = CreateObject("vbscript.regexp")
motifs = Array("\(\d+\)", "A|D", "a|m")
rplts = Array("", 10, "")
With reg
.Global = True
For i = LBound(motifs) To UBound(motifs)
.Pattern = motifs(i)
If .test(chaine) Then chaine = .Replace(chaine, rplts(i))
Next i
.Pattern = "\d+"
If .test(chaine) Then Set subdiv = .Execute(chaine)
For i = 0 To subdiv.Count - 1
SommeLettres = SommeLettres + subdiv(i).Value
Next i
End With
End Function
où, si j'ai bien compris, les A et D valent 10, les a et m valent *1 et les (*) valent 0.
Cdlt,