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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| Private Sub ListBoxinventaireint_Click()
Dim i As Integer
Me.ListBoxinventaireint2.Clear
Application.ScreenUpdating = False
With Sheets("BDJ")
.Range("B2").AutoFilter
.Range("B2").AutoFilter field:=2, Criteria1:=Me.ListBoxinventaireint.Value
If pl.SpecialCells(xlCellTypeVisible).Rows.Count > 0 Then
For Each cel In pl.SpecialCells(xlCellTypeVisible)
With Me.ListBoxinventaireint2
.AddItem cel.Value
For i = 1 To 9
.Column(i, .ListCount - 1) = cel.Offset(0, i)
Next i
.Column(9, .ListCount - 1) = cel.Row
End With
Next cel
End If
.Range("B2").AutoFilter
End With
Application.ScreenUpdating = True
End Sub
Private Sub UserForm_Initialize()
Dim dico As Object
Dim dl As Integer
Set dico = CreateObject("Scripting.Dictionary")
With Sheets("BDJ")
If .AutoFilterMode Then
End If
dl = .Cells(Application.Rows.Count, 1).End(xlUp).Row
Set pl = .Range("B2:B" & dl)
End With
For Each cel In pl
dico(cel.Value) = ""
Next cel
Me.ListBoxinventaireint.List = dico.keys
End Sub |
Partager