Plusieurs listes deroulantes dans userform

  • Initiateur de la discussion Initiateur de la discussion Geraldine
  • Date de début Date de début

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 !

Geraldine

XLDnaute Occasionnel
re Bonjour,

Je n'arrive pas à alimenter deux ou trois listes deroulantes dans la meme userform.
J'ai honte de poser cette question mais le seul sujet que j'ai trouvé, je n'ai pu charger le fichier exemple.

Merci, bonne fin d'après midi

Pour ma comboboxCF :Private Sub UserForm_Initialize()
Dim Plage As Range
Dim Tab1() As String
With Sheets("INFOS")
Set Plage = .Range("H7:H" & .Range("H65536").End(xlUp).Row)
End With
ReDim Tab1(1 To Plage.Count)
For Each Cell In Plage
i = i + 1
Tab1(i) = Cell
Next
ComboBoxCF.List = Tab1
End Sub


Pour ma ComboboxM :
With Sheets("INFOS")
Set Plage = .Range("J7:J" & .Range("J65536").End(xlUp).Row)
End With
ReDim Tab1(1 To Plage.Count)
For Each Cell In Plage
i = i + 1
Tab1(i) = Cell
Next
ComboBoxM.List = Tab1
 
Re : Plusieurs listes deroulantes dans userform

qu'est ce que ca met comme erreur pour que ca bloque? normalement rien ne change tu les remplis comme si il n'y en avait qu'une....

ps: au fait tu peux mettre ton code en " [code"] [/code]"
Code:
plutot que en italique
😛
 
Dernière édition:
Re : Plusieurs listes deroulantes dans userform

Géraldine

ajout d'une checkbox pour choix article,ouvrage


Private Sub CheckBox1_Click()
Dim Plg As Variant

If CheckBox1 = True Then
CheckBox1.Caption = "Article"
With Sheets("INFOS")
Plg = .Range("H7:H" & .Range("H65536").End(xlUp).Row)
End With
Else
CheckBox1.Caption = "Ouvrage"
With Sheets("INFOS")
Plg = .Range("J7:J" & .Range("J65536").End(xlUp).Row)
End With
End If

ComboBoxCF.ListIndex = -1
ComboBoxCF.List = Plg

End Sub

Private Sub UserForm_Initialize()
Dim Plg As Variant

With Sheets("INFOS")
Plg = .Range("B7:B" & .Range("B65536").End(xlUp).Row)
End With
ComboBoxF1.List = Plg

With Sheets("INFOS")
Plg = .Range("F7:F" & .Range("F65536").End(xlUp).Row)
End With

ComboBoxM.List = Plg

'code famille article ouvrage
CheckBox1 = True

'With Sheets("INFOS")
'Plg = .Range("H7:H" & .Range("H65536").End(xlUp).Row)
'End With
'ComboBoxCF.List = Plg

End Sub

à bientôt
 
Re : Plusieurs listes deroulantes dans userform

bonsoir,

je suis un peu perdu ... mais vraiment merci de toutes tes contributions mr bebere. 🙂
Je doit réflechir à ce que tu me proposes, maisje me demande si tu n'as pas rajouté un code concernant un autre post. 😕

et encore merci et à chloulou aussi

bonne soirée, géradline
 
Re : Plusieurs listes deroulantes dans userform

Bonsoir à tous et aux autres,

Code à compléter et tester :
Code:
Private Sub UserForm_Initialize()
With Sheets("INFOS")
    ComboBoxCF.List = .Range("H7:H" &.Range("H65536").End(xlUp).Row).Value
    ComboBoxM.List = .Range("F7:F" & .Range("H65536").End(xlUp).Row).Value
    etc...

End With
End Sub

@voir même abusivement :
 
- 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

  • Question Question
Microsoft 365 worksheet_change
Réponses
29
Affichages
1 K
Réponses
4
Affichages
734
Retour