Combobox en cascade avec retrait des choix

Bonjour à tous le forum,

je me permets de poster car je suis confronté à une nouvelle problématique . J'ai une liste prénoms et j'ai 4 combobox qui reprennent 4 intervenants. J'aimerais que lorsque je sélection un prénom dans la première combobox, il n'apparaisse plus dans la second et ainsi de suite.

En vous remerciant d'avance pour vos retours.

15test1.xlsm (17.08 Ko)

Bonjour,

A coller dans le module de l'UserForm :

Private Sub UserForm_Initialize()

    Dim Plage As Range
    Dim Cel As Range

    With Worksheets("Feuil1"): Set Plage = .Range(.Cells(4, 1), .Cells(.Rows.Count, 1).End(xlUp)): End With

    For Each Cel In Plage

        ComboBox1.AddItem Cel.Value

    Next Cel

End Sub

Private Sub ComboBox1_Click()

    Remplir ComboBox1, ComboBox2

End Sub

Private Sub ComboBox2_Click()

    Remplir ComboBox2, ComboBox3

End Sub

Private Sub ComboBox3_Click()

    Remplir ComboBox3, ComboBox4

End Sub

Sub Remplir(CB1 As MSForms.ComboBox, CB2 As MSForms.ComboBox)

    Dim I As Integer

    For I = 0 To CB1.ListCount - 1

        If I <> CB1.ListIndex Then CB2.AddItem CB1.List(I)

    Next I

End Sub

Salut Theze,

Sa marche super bien je te remercie beaucoup c'est super Good Job

Un grand merci à toi.

Rechercher des sujets similaires à "combobox cascade retrait choix"