bonjour aux courageux du dimanche
j'ai cette petite procédure qui me permets d'alimenter une listbox en fonction du choix d'un combobox, le problème ce sont les doublons malheureusement
quelqu'un aurait il une solution car celle glanées sur le phorum ne fonctionne pas (je dois mal les appliquer)
merci d'avance
munity
Private Sub ComboBox1_Change()
Dim val As Variant, val2 As Variant
ListBox1.Clear
With Sheets("test")
Plg = .Range("a2:l" & .Range("A65536").End(xlUp).Row)
End With
For L = 1 To UBound(Plg, 1)
On Error Resume Next 'suite infos sur phorum mais ca marche pas snif If Plg(L, 3) = ComboBox1 Then
With ListBox1
.AddItem Plg(L, 5)
.List(.ListCount - 1, 1) = Plg(L, 6)
.List(.ListCount - 1, 2) = Plg(L, 7)
On Error Resume Next
End With
End If
Next L
ListBox1.BackColor = &HFFFFFF
ComboBox1.BackColor = &HFFFFFF
TextBox1 = ComboBox1.Value
End Sub
j'ai cette petite procédure qui me permets d'alimenter une listbox en fonction du choix d'un combobox, le problème ce sont les doublons malheureusement
quelqu'un aurait il une solution car celle glanées sur le phorum ne fonctionne pas (je dois mal les appliquer)
merci d'avance
munity
Private Sub ComboBox1_Change()
Dim val As Variant, val2 As Variant
ListBox1.Clear
With Sheets("test")
Plg = .Range("a2:l" & .Range("A65536").End(xlUp).Row)
End With
For L = 1 To UBound(Plg, 1)
On Error Resume Next 'suite infos sur phorum mais ca marche pas snif If Plg(L, 3) = ComboBox1 Then
With ListBox1
.AddItem Plg(L, 5)
.List(.ListCount - 1, 1) = Plg(L, 6)
.List(.ListCount - 1, 2) = Plg(L, 7)
On Error Resume Next
End With
End If
Next L
ListBox1.BackColor = &HFFFFFF
ComboBox1.BackColor = &HFFFFFF
TextBox1 = ComboBox1.Value
End Sub