Microsoft 365 forcer REMPLISSAGE Combobox Userform

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

eric72

XLDnaute Accro
Bonjour à tous,
J'espère que tout le monde va bien, me revoilà pour un petit souci de conditions d'obligation de remplissage de Combobox.
J'ai un Userform, quand je clique sur l'optionbutton "Tournant", s'affiche une combobox ou on sélectionne un nombre de semaines qui déclenche l'affichage de 2, 3,4,5 ou 6 autres combobox que l'on doit remplir obligatoirement, j'ai donc mis ceci:
VB:
    If ObRotation.Value = True And CDbl(CbNbSemRotation.Value) = 2 And CbSemType1.Value = "" Or CbSemType2.Value = "" Then MsgBox "Vous devez sélectionner 2 Semaines type": Exit Sub
    If ObRotation.Value = True And CDbl(CbNbSemRotation.Value) = 3 And CbSemType1 = "" Or CbSemType2 = "" Or CbSemType3 = "" Then MsgBox "Vous devez sélectionner 3 Semaines type": Exit Sub
    If ObRotation.Value = True And CDbl(CbNbSemRotation.Value) = 4 And CbSemType1 = "" Or CbSemType2 = "" Or CbSemType3 = "" Or CbSemType4 = "" Then MsgBox "Vous devez sélectionner 4 Semaines type": Exit Sub
    If ObRotation.Value = True And CDbl(CbNbSemRotation.Value) = 5 And CbSemType1 = "" Or CbSemType2 = "" Or CbSemType3 = "" Or CbSemType4 = "" Or CbSemType5 = "" Then MsgBox "Vous devez sélectionner 5 Semaines type": Exit Sub
    If ObRotation.Value = True And CDbl(CbNbSemRotation.Value) = 6 And CbSemType1 = "" Or CbSemType2 = "" Or CbSemType3 = "" Or CbSemType4 = "" Or CbSemType5 = "" Or CbSemType6 = "" Then MsgBox "Vous devez sélectionner 6 Semaines type": Exit Sub

Je ne sais pas ou est(sont) la(les) boulette(s), mais rien ne fonctionne, j'ai essayé pleins d'astuces et rien ne va, quelqu'un aurait-il une petite idée car là je cale!!!
Merci beaucoup à tous.
Eric
 

Pièces jointes

Solution
Bonsoir le Fil
une autre possibilité
VB:
 If TxtDateRotation = "" And ObRotation = True Then MsgBox "Vous devez Sélectionner une date de début ": Exit Sub
    If TxtDateFixe = "" And ObFixe = True Then MsgBox "Vous devez Sélectionner une date de début ": Exit Sub
    If ChbMajoration = True And TxtTaux = "" Then MsgBox "Vous devez saisir un taux de Majoration": TxtTaux.SetFocus: Exit Sub
    If ObFixe.Value = False And ObRotation.Value = False Then MsgBox "Vous devez choisir si le planning est fixe ou tournant": Exit Sub
    If ObFixe.Value = True And CbSemTypeFixe = "" Then MsgBox "Vous avez choisi un Planning fixe, vous devez sélectionner la Semaine Type attribuée": CbSemTypeFixe.SetFocus: Exit Sub

Select Case ObRotation.Value 'ça...
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
2
Affichages
124
Réponses
4
Affichages
143
Réponses
10
Affichages
357
Réponses
0
Affichages
536
Retour