Private Sub CommandButton1_Click() Dim toto As String, a As Double, b As Double, c As Double toto = "0,0018x2-0,1414x+2,7" a = extrait(toto, "x2") b = extrait(toto, "x") c = toto MsgBox a & vbCrLf & b & vbCrLf & c End Sub Private Function extrait(ByRef toto As String, ByVal sep As String) As Double Dim pos As Integer pos = InStr(toto, sep) extrait = CDbl(Mid(toto, 1, pos - 1)) toto = Mid(toto, pos + Len(sep)) End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionFor i = 6 To 8 c = "B" & i ' ma cellule où je veux copier Chaine '(...) Chaine = Replace(Chaine, "x2", "*" & c & "^2") '(...) Next
Oh! Que c'est loin tout ça...
ce qui permettrait de ne pas avoir à saisir "x2" & "x" à chaque fois