Bonjour,
J'ai une question. J'ai un fichier pour le travail. Je dois créer deux listes déroulantes avec selection multi sur VBA.
Le problème est que j'arrive à une liste mais je ne sais pas comment créer une deuxieme liste sur le même onglet.
Voila le code que j'ai fait sur VBA pour la première liste déroulante.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect([C2:C1048576], Target) Is Nothing And Target.Count = 1 Then
Me.ListBox1.MultiSelect = fmMultiSelectMulti
Me.ListBox1.List = Sheets("DATA").Range("C2:C22").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 = 100
Me.ListBox1.Width = 200
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
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
J'aurais besoin de faire la même chose mais sur la colonne D du fichier?
Pourriez-vous m'aider s'il vous plait?
bonne journée à vous