TextBox avec condition

Bonjour,

Je souhaiterai placé une condition sur une TextBox si vide.

exemple :

If TxtB_Entreprise = "" Then
            For Each Cell In .Range("F2:F" & .Range("F65000").End(xlUp).Row)        ' .............Pays Domicile
                Me.CmbB_Pays_Domicile.AddItem (Cell)
            Next Cell
        Else
            If TxtB_Entreprise <> "" Then
                For Each Cell In .Range("F2:F" & .Range("F65000").End(xlUp).Row)        ' .........Pays Bureau
                    Me.CmbB_Pays_Bureau.AddItem (Cell)
                Next Cell
            End If
        End If

Je joins le fichier

Cordialement

19userform.xlsm (194.81 Ko)

Bonjour Le_Troll_Du_27,

Es-ce cela que tu recherches?

If nomTexteBox.Text = "" Then
   'actions à réaliser si la txtbox est vide
Else
    'actions à réaliser si la txtbox n'est vide
End If

Bonjour, d3d9x

la structure que présente est la même.

Ce que je recherche ici c'est :

    With Sheets("DONNEES")

        For Each Cell In .Range("A2:A" & .Range("A65000").End(xlUp).Row)        ' ..Nom des groupes
            Me.CmbB_Groupe_Nom.AddItem (Cell)
        Next Cell
        For Each Cell In .Range("U2:U" & .Range("U65000").End(xlUp).Row)        ' ..Civilité / Statut
            Me.CmbB_Civilite.AddItem (Cell)
        Next Cell
        If TxtB_Entreprise = "" Then
            'actions à réaliser si la TxtB_Entreprise  est vide
            TxtB_Adresse_Domicile.Text = LCase(TxtB_Adresse_Domicile)        ' .....Adresse Domicile
            Me.CmbB_Code_Postal_Domicile.List = dico.keys        ' .................Code Postal Domicile
            For Each Cell In .Range("F2:F" & .Range("F65000").End(xlUp).Row)
                Me.CmbB_Pays_Domicile.AddItem (Cell)        ' ......................Pays Domicile
            Next Cell
            TxtB_Telephone_Domicile.Text = LCase(TxtB_Telephone_Domicile)        ' .Téléphone Domicile
        Else
            'actions à réaliser si la TxtB_Entreprise  est non vide
            TxtB_Adresse_Bureau.Text = LCase(TxtB_Adresse_Domicile)        ' .......Adresse Bureau
            Me.CmbB_Code_Postal_Bureau.List = dico.keys        ' ...................Code Postal Bureau
            For Each Cell In .Range("F2:F" & .Range("F65000").End(xlUp).Row)
                Me.CmbB_Pays_Bureau.AddItem (Cell)        ' ........................Pays Bureau
            Next Cell
            TxtB_Telephone_Bureau.Text = LCase(TxtB_Telephone_Bureau)        ' .....Téléphone Bureau
        End If

    End With

Voilà en gros

Rechercher des sujets similaires à "textbox condition"