Sub Archiv()
Dim Dec&, Lig&, Cel As Range
If MsgBox("Voulez vous archiver les éléments terminés ?", vbYesNo, "Confirmation") = vbYes Then
Me.Unprotect
Set Cel = Me.[AF9]: Dec = 1
With Worksheets("archive")
Lig = PremièreCelluleVideSousDernièreCelluleNonVide(.[AF1]).Row
Do
Select Case Cel.Offset(Dec).Value
Case "Terminé"
Cel.Offset(Dec).EntireRow.Cut Destination:=.Rows(Lig): Lig = 1 + Lig
Me.Rows(Cel.Offset(Dec).Row).EntireRow.Delete
Case Empty: Exit Sub
Case Else: Dec = 1 + Dec
End Select
Loop
End With
Me.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowInsertingRows:=True, _
AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
End If
End Sub