Bonjour à tous !!!
J'ai fais un petit formulaire de saisie pour suivre les locations de véhicule perso.
en revanche je ne trouve pas le moyens de rajouter une fonction modifier et filtrer.
j'ai beau rajouter ce code...en vain.
Private Sub FilterListBox()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Synthèse")
Dim LastRow As Long
LastRow = ws.Cells(ws.Rows.Count, "I").End(xlUp).Row
Dim filterValue As String
filterValue = UCase(ComboBox4.Value)
' Supprimer tous les éléments actuels de la ListBox1
Dim i As Long
For i = ListBox1.ListCount - 1 To 0 Step -1
ListBox1.RemoveItem i
Next i
Dim rowCounter As Long
rowCounter = 0
For i = 11 To LastRow
If InStr(1, UCase(ws.Cells(i, "I").Value), filterValue) > 0 Then
ListBox1.AddItem ws.Cells(i, "A").Value
ListBox1.List(rowCounter, 1) = ws.Cells(i, "B").Value
ListBox1.List(rowCounter, 2) = ws.Cells(i, "C").Value
ListBox1.List(rowCounter, 3) = ws.Cells(i, "D").Value
ListBox1.List(rowCounter, 4) = ws.Cells(i, "E").Value
ListBox1.List(rowCounter, 5) = ws.Cells(i, "F").Value
ListBox1.List(rowCounter, 6) = ws.Cells(i, "G").Value
ListBox1.List(rowCounter, 7) = ws.Cells(i, "H").Value
ListBox1.List(rowCounter, 8) = ws.Cells(i, "I").Value
ListBox1.List(rowCounter, 9) = ws.Cells(i, "J").Value
ListBox1.List(rowCounter, 10) = ws.Cells(i, "K").Value
ListBox1.List(rowCounter, 11) = ws.Cells(i, "L").Value
rowCounter = rowCounter + 1
End If
Next i
End Sub