Bonjour,
à tester,
Private Sub ComboBox1_Change()
Dim liste As Variant, i As Long, j As Integer, n As Integer, cl As Variant, frm As Variant
Dim LB2(), NoPol As String, rw As Long, tt As String
rw = Sheets("Feuil1").Cells(Rows.Count, 1).End(xlUp).Row
NoPol = Me.ComboBox1.List(Me.ComboBox1.ListIndex)
cl = Array(1, 2, 3, 4, 5, 6, 7)
liste = Sheets("Feuil1").Range("A1:G" & rw).Value
For i = LBound(liste) To UBound(liste)
If i <> 1 And liste(i, 5) <> NoPol Then
Sheets("Feuil1").Cells(i, "F") = Me.ComboBox1
Sheets("Feuil1").Cells(i, "G") = Date
End If
If i = 1 Or liste(i, 5) <> NoPol Then
n = n + 1
For j = LBound(cl) To UBound(cl)
ReDim Preserve LB2(UBound(cl), n)
LB2(j, n - 1) = liste(i, cl(j)) 'Format(liste(i, cl(j)), frm(j))
Next j
End If
Next i
Me.ListBox1.List = Application.Transpose(LB2)
End Sub
Private Sub UserForm_Initialize()
Me.ListBox1.ColumnCount = 7
TextBox1.Value = Format(Now(), "dd/mm/yyyy")
ComboBox1.List = Feuil2.Range("A2:A" & Feuil2.Range("A" & Rows.Count).End(xlUp).Row).Value 'responsable_saisie
End Sub