Option Explicit
Dim L As Byte
Private Sub UserForm_Initialize()
With ListView1
For L = 3 To 10
If Cells(L, 1) <> "remplacement" Then
.ListItems.Add , ""
.ListItems(.ListItems.Count).ListSubItems.Add , , Cells(L, 1)
.ListItems(.ListItems.Count).ListSubItems.Add , , Cells(L, 2)
End If
Next
End With
End Sub
Private Sub CommandButton1_Click()
Dim Est As Range, L As Byte, Li As Byte
With ListView1
For L = 1 To .ListItems.Count
If .ListItems(L).Checked Then Range(Cells(L + 2, 1), Cells(L + 2, 7)).ClearContents
Next
Set Est = [A3:A10].Find("remplacement")
If Est Is Nothing Then L = 10 Else L = Est.Row - 1
Range("A3:G" & L).Sort , key1:=[A3], Order1:=xlAscending, Key2:=[B3], Order2:=xlAscending
Set Est = [A3:A10].Find("")
If Est Is Nothing Then L = 10 Else L = Est.Row
For Li = L To 10
Cells(Li, 1) = "remplacement"
Cells(Li, 2) = Li - L + 1
Next
End With
Range("B1").Select
Unload UserForm2
UserForm2.Show
End Sub
Private Sub CommandButton2_Click()
Unload UserForm2
End Sub