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 27 28 29
|
Sub Delete_Rows_Based_On_Value()
Dim ws As Worksheet
Dim filterRange As Range
Set ws = ThisWorkbook.Worksheets("Sheet1") ' modifier par ton nom de feuille
Set filterRange = ws.Range("B1:B2000")
On Error Resume Next
ws.ShowAllData
On Error GoTo 0
filterRange.AutoFilter Field:=1, Criteria1:="" '1)
Application.DisplayAlerts = False
filterRange.SpecialCells(xlCellTypeVisible).Delete '2
Application.DisplayAlerts = True
On Error Resume Next
ws.ShowAllData '3
On Error GoTo 0
Set ws = Nothing
Set filterRange = Nothing
End Sub |
Partager