Affichage CommandButton selon Qte

Bonjour

Pourriez vous m'aider

Je choisi en listbox1 mon article

j'additionne ou soustrait

Dans la textbox6 je range le résultat dans la feuille1 colonne B en fonction de mon choix en listbox1 en appuyant sur valider

Par contre j'aimerai que si le résultat dans la textbox6 est en dessous du nombre dans la feuille1 colonne E le commandbutton7 apparaisse

Merci d'avance

FEBFEB

16test-2.xlsm (20.06 Ko)

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,

Merci beaucoup

Bonjour

Dans le fichier de Xorsankukai cela fonctionne super bien mais dans mon fichier joint cela ne marche pas

je ne comprends pas pourquoi

Merci d'avance pour votre solution

FEBFEB

Rechercher des sujets similaires à "affichage commandbutton qte"