ListBox liste choix multiples
Bonjour,
je suis novice avec Excel, voici mon problème
J'ai créée un tableau avec plusieurs colonnes, notamment :
Colonne K : Filiale
Colonne I : Missions
J'ai créée une listbox pour pouvoir sélectionner plusieurs missions dans la même cellule (Exemple, choisir dans la colonne Missions : structure, fluides, acoustiques,....)
Jusque la tout vas bien. Par contre j'aimerai avoir une autre liste pour la colonne K Filiale avec une liste à choix multiples différente de la colonne I
Voici le code rentrée pour la colonne mission :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect([L2:L30], Target) Is Nothing And Target.Count = 1 Then
Me.ListBox1.MultiSelect = fmMultiSelectMulti
Me.ListBox1.List = Sheets("criteres").Range("A2:A30").Value
a = Split(Target, " ")
If UBound(a) >= 0 Then
For i = 0 To Me.ListBox1.ListCount - 1
If Not IsError(Application.Match(Me.ListBox1.List(i), a, 0)) Then Me.ListBox1.Selected(i) = True
Next i
End If
Me.ListBox1.Height = 80
Me.ListBox1.Width = 100
Me.ListBox1.Top = Target.Top
Me.ListBox1.Left = Target.Left + Target.Width
Me.ListBox1.Visible = True
Else
Me.ListBox1.Visible = False
End If
End Sub |
Code:
1 2 3 4 5 6
| Private Sub ListBox1_Change()
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then temp = temp & Me.ListBox1.List(i) & " "
Next i
ActiveCell = Trim(temp)
End Sub |
Comment puis-je faire ?
Merci de vos aides.