Re : Une aide pour recherche multiple
Bonsoir,
Un exemple:
Menus en cascade
Private Sub UserForm_Initialize()
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range([B4], [B65000].End(xlUp))
If Not mondico.Exists(c.Value) Then mondico.Add c.Value, c.Value
Next c
Me.ComboBox1.AddItem "*"
For Each i In mondico.items
Me.ComboBox1.AddItem i
Next
Me.ComboBox1.ListIndex = 0
End Sub
Private Sub ComboBox1_Change()
i = 0
Me.ListBox1.Clear
For Each c In Range([A4], [A65000].End(xlUp))
If c.Offset(0, 1) = Me.ComboBox1 Or Me.ComboBox1 = "*" Then
Me.ListBox1.AddItem c
i = i + 1
End If
Next c
End Sub
Private Sub ListBox1_Click()
Set c = [A:A].Find(what:=Me.ListBox1)
If Not c Is Nothing Then
Me.TextBox1 = Cells(c.Row, 3)
Me.TextBox2 = Cells(c.Row, 4)
End If
End Sub
JB
Formation Excel VBA JB