Bonsoir mercatog

Merci pour votre code.
J'aimerais m'en servir, mais la 2ème combobox est vide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Private Sub UserForm_Initialize()
Dim MonDico As Object
Dim C As Range
 
Set MonDico = CreateObject("Scripting.Dictionary")
With Feuil2
    For Each C In .Range("B2:B" & .Cells(.Rows.Count, 2).End(xlUp).Row)
        MonDico(C.Value) = C.Value
    Next C
End With
Me.Cbx_GrAlim.List = MonDico.items 'ma 1ère combobox
 
Set MonDico = Nothing
End Sub
 
Private Sub Cbx_GrAlim_Change()
Dim MonDico As Object
Dim C As Range
 
If Me.Cbx_GrAlim.ListIndex > -1 Then
    Set MonDico = CreateObject("Scripting.Dictionary")
    With Feuil2
        For Each C In .Range("D2:D" & .Cells(.Rows.Count, 2).End(xlUp).Row)
            If C.Offset(, -1) = Me.Cbx_GrAlim.Value Then MonDico(C.Value) = C.Value
        Next C
    End With
    With Me.Cbx_Alim 'Ma 2ème combobox
        .List = MonDico.items
        .ListIndex = -1
    End With
 
    Set MonDico = Nothing
End If
End Sub
Mes colonnes sont la colonne 2 et 4.

Le pas à pas indique : Me.Cbx_Alim = ""

Merci à vous