Bonjour à tous,
Je recherche à remplir une listbox, en fonction des valeurs sous une cellule déterminé par la méthode FIND
Je n'arrive pas à déterminer la cellule num.. ERREUR : Incompatibilité de type.
La méthode find ne renvoie pas une addresse ?
Je vous remercie d'avance,Code:
1
2
3
4
5
6
7
8
9
10
11
12
13 Private Sub ComboBox1_Click() Dim num As Range ListBox1.Clear Dim j As Long With Worksheets("Liste") Set num = .Range("A1:AY1").Find(ComboBox1.Value, xlValues, xlWhole, , , True) MsgBox .Cells(num.Row, num.Column) For j = 20 To Worksheets("Liste").Cells(num.Row, num.Column).End(xlUp).Row Me.ListBox1.AddItem Worksheets("Liste").Cells(j, num.Column) Next j End With End Sub
Gaétan