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
| Private Sub trechcat_Change()
Dim cel As Range, celcat As Range
Dim i As Integer, j As Integer
'charge la ListBox en fonction des lettres entrées
Listerech.Clear
Listerech.ColumnWidths = "90 pt;90 pt;0 pt;130 pt;90 pt;100 pt;100 pt;100 pt;0pt;1pt"
Listerech.Width = 715
Listerech.Height = 366
If trechcat.Text = "" Then Exit Sub
j = 0
For Each celcat In plage
If UCase(celcat.Value) Like UCase(trechcat.Text) & "*" Then
Set cel = celcat.Offset(0, -5)
Listerech.AddItem cel.Value
For i = 1 To 9
Listerech.List(Listerech.ListCount - 1, i) = cel.Offset(0, i).Text
Next i
j = j + 1
End If
Next celcat
End Sub |