Bonsoir
voila une listview1 a voir
Private Sub UserForm_Activate()
With ListView1
'Titres des colonnes
With .ColumnHeaders
.Clear
'Ajout des colonnes
.Add , , "Num", 0
.Add , , "TITRE1", 48
.Add , , "TITRE2.", 50, lvwColumnLeft
.Add , , "TITRE3", 85, lvwColumnLeft
.Add , , "TITRE4", 50, lvwColumnCenter
.Add , , "TITRE5", 35, lvwColumnCenter
End With
.View = lvwReport ' Affichage en mode Rapport
.Gridlines = True ' Affichage d'un quadrillage
.FullRowSelect = True ' Sélection des lignes complètes
.LabelEdit = lvwManual ' On ne modifie pas en direct
End With
InitListe ""
End Sub
Private Sub InitListe(Nom As String)
Dim L As Long
Set Sh = Feuil1
Nlig = Sh.Range("A" & Rows.Count).End(xlUp).Row
With ListView1
.ListItems.Clear
For L = 2 To Nlig
If UCase(Sh.Cells(L, 1)) Like UCase(TextBox1.Value) & "*" Then
.ListItems.Add , , L ' Numéro de la ligne
.ListItems(.ListItems.Count).ListSubItems.Add , , Sh.Cells(L, 1)
.ListItems(.ListItems.Count).ListSubItems.Add , , Sh.Cells(L, 2)
.ListItems(.ListItems.Count).ListSubItems.Add , , Sh.Cells(L, 3)
.ListItems(.ListItems.Count).ListSubItems.Add , , Sh.Cells(L, 4)
.ListItems(.ListItems.Count).ListSubItems.Add , , Sh.Cells(L, 5)
End If
Next
End With
On Error Resume Next
ListView1.ListItems(1).Selected = False
Set ListView1.SelectedItem = Nothing
End Sub
Private Sub TextBox1_Change()
InitListe TextBox1.Value
End Sub