Microsoft 365 forcer REMPLISSAGE Combobox Userform

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

  • test.xlsm
    98.9 KB · Affichages: 8
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...

Statistiques des forums

Discussions
312 213
Messages
2 086 307
Membres
103 174
dernier inscrit
OBUTT