XL 2019 condition pour activer buttoncommande userform

PETIT YANNICK

XLDnaute Occasionnel
bonjour,

je cherche a faire afficher un buttoncommand (butoncommand5) si TextBox1,TextBox2,TextBox4,TextBox5,TextBox6,TextBox7,TextBox8 ne sontpas vide et si la longueur renseigné textbox10 est de 3 caractères.

Avez vous une idée pour coder ma demande.

j'avais penser a ce code mais ca ne fonctionne pas

If TextBox1 <> "" And TextBox2 <> "" And TextBox4 <> "" And TextBox5 <> "" And TextBox6 <> "" And TextBox7 <> "" And TextBox8 <> "" And Len(TextBox10) = 3 Then
CommandButton5.Enabled = True
Else
CommandButton5.Enabled = False
End If

Merci d'avance
 

Pièces jointes

  • Products catalogue.xlsm
    40.3 KB · Affichages: 11

danielco

XLDnaute Accro
Bonjour,

VB:
Private Sub TextBox4_Change()
If Len(TextBox4) > 30 Then MsgBox " Nombre  de 30 caractères atteint!"
    If TextBox1 <> "" And TextBox2 <> "" And TextBox4 <> "" And TextBox5 <> "" And TextBox6 <> "" And TextBox7 <> "" And Len(TextBox10) <> 3 And TextBox10 <> "" Then
    CommandButton5.Enabled = True
        CommandButton5.Visible = True
        Else
        CommandButton5.Enabled = False
        CommandButton5.Visible = False
    End If
End Sub

Cordialement.

Daniel
 

Discussions similaires

Statistiques des forums

Discussions
312 206
Messages
2 086 207
Membres
103 157
dernier inscrit
youma