Option Explicit
Private Sub cmdRsd_Click()
Dim a#, b#, s$
If txtA = "" Then MsgBox "Vous devez donner a !": txtA.SetFocus: Exit Sub
a = Val(Replace$(txtA, ",", ".")): If a = 0 Then MsgBox "a = 0 => Pas de solution !": Exit Sub
If txtB = "" Then MsgBox "Vous devez donner b !": txtB.SetFocus: Exit Sub
b = Val(Replace$(txtB, ",", ".")): s = Replace(LTrim$(Str$(-b / a)), ".", ",")
If Left$(s, 2) = "-," Then s = "-0," & Right$(s, Len(s) - 2)
If Left$(s, 1) = "," Then s = "0" & s
txtX.Caption = s: cmdClr.SetFocus
End Sub
Private Sub cmdClr_Click()
txtX.Caption = "": txtB = "": txtA = "": txtA.SetFocus
End Sub
Private Sub txtA_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 27 Then Unload Me
End Sub