Salut à toi,
Oh, des fichiers Gerber !
Eh, il peut y avoir des espaces dans un tel fichier.
Function GetGerberValue(formula As String, letter As String) As Double
Dim i As Integer
Dim b As Boolean
Dim s As String
Dim c As String
GetGerberValue = 0
b = False
s = ""
For i = 1 To Len(formula)
c = Mid(formula, i, 1)
If b Then
If Not (c = "." Or (c >= "0" And c <= "9" ) Or c = "+" Or c = "-") Then Exit For
s = s + c
ElseIf c = letter Then
b = True
End If
Next
If s = "" Then
' // Pas trouvé
Exit Function
End If
GetGerberValue = CDbl(s)
End Function