Re febfeb,
Pour rester simple :
J'ai rajouter un textbox4 qui récupère la valeur du minima (la textbox4 est masquée).
Private Sub UserForm_Initialize()
TextBox4.Visible = False
End Sub
Private Sub ListBox1_Change()
'range l'information de la listbox en textbox2 et textbox3 & textbox4
If Me.ListBox1.ListIndex <> -1 Then
Me.TextBox2 = Sheets("feuil1").Range("b" & Me.ListBox1.List(Me.ListBox1.ListIndex))
Me.TextBox3 = Sheets("feuil1").Range("c" & Me.ListBox1.List(Me.ListBox1.ListIndex))
Me.TextBox4 = Sheets("feuil1").Range("e" & Me.ListBox1.List(Me.ListBox1.ListIndex))
End If
End Sub
Je compare Textbox6 et textbox4 et je fais apparaitre commandbutton7 si le résultat est<
Private Sub TextBox6_Change()
'ajout l'ecriture en textbox 4 dans une cellule selectionnée
If TextBox2 = "" Then
For I = 1 To 12
Controls("Textbox" & I) = ""
Next I
End If
If TextBox2 = "" Then Exit Sub
If TextBox6 <= 0 Then
CommandButton6.Visible = True
End If
If TextBox6.Value < TextBox4.Value Then
CommandButton7.Visible = True
End If
End Sub
En revanche tu verras également apparaitre commandbutton6 si le résultat est <=0
Cordialement,