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 35 36 37 38 39 40
| Dim f
Private Sub UserForm_Initialize()
Set f = Sheets("BD")
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[A2], f.[A65000].End(xlUp))
mondico(c.Value) = c.Value
Next c
Me.LB_LIEUX.List = mondico.items
'Me.LB_Lieux.MultiSelect = fmMultiSelectMulti
End Sub
Private Sub LB_Lieux_Change()
Me.LB_Ref.Clear
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[A2], f.[A65000].End(xlUp))
For k = 0 To Me.LB_LIEUX.ListCount - 1
If Me.LB_LIEUX.Selected(k) = True Then
If c = Me.LB_LIEUX.List(k, 0) Then
temp = c.Offset(, 1)
mondico(temp) = temp
End If
End If
Next k
Next c
Me.LB_Tache.List = mondico.items
End Sub
Private Sub LB_Tache_Change()
Me.LB_Ref.Clear
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[B2], f.[B65000].End(xlUp))
For k = 0 To Me.LB_Tache.ListCount - 1
If Me.LB_Tache.Selected(k) = True Then
If c = Me.LB_Tache.List(k, 0) Then
temp = c.Offset(, 1)
mondico(temp) = temp
End If
End If
Next k
Next c
Me.LB_Ref.List = mondico.items
End Sub |
Partager