Bonjour
J'applique un code qui me supprime des lignes selon la condition "#VALEUR!" mais il me reste toujours quelques lignes et ceci après la suppression de toutes les autres. Comment modifier ce code de façon qu'il supprime toutes les lignes.
Merci pour votre aide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Sub Module05SupprimerLignesSelonCondition()
 
 
Dim i As Long, LigDeb As Long, LigFin As Long
 
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With ActiveCell.CurrentRegion
    LigDeb = .Cells(1).Row
    .Cells(1).EntireRow.Insert
    LigFin = LigDeb + .Rows.Count
End With
With ActiveSheet
    If LigFin - LigDeb > 1 Then
        .Range(.Cells(LigDeb, 1), .Cells(LigDeb, 5)).Value = "#VALUE!"
        ActiveCell.CurrentRegion.AdvancedFilter xlFilterInPlace, , , True
        For i = LigFin To LigDeb + 1 Step -1
            If .Rows(i).Hidden Then .Rows(i).Delete
        Next i
    End If
    .Rows(LigDeb).Delete
    If .FilterMode And Cells(LigDeb, 1).CurrentRegion.Rows.Count > 1 Then .ShowAllData
    Cells(LigDeb, 1).Select
End With
Application.DisplayAlerts = True
End Sub