Bonsoir,
pour éviter le if ....:
Sub ev()
Dim i As Double
limite = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
Application.ScreenUpdating = False
For i = limite To 1 Step -1
j = 1
While Not (IsEmpty(Cells(i, j))) And j < 17
j = j + 1
Wend
If j < 17 Then
Cells(i, j).EntireRow.Select
Selection.Delete Shift:=xlUp
End If
Next i
Application.ScreenUpdating = True
End Sub
j=1 colonne début A
j=17 colonne fin P +1
_______________________________________________________________________________________
ou encore:
_______________________________________________________________________________________
Sub w()
Application.ScreenUpdating = False
limite = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
Do
Range(Cells(1, 1), Cells(limite, 16)).Select
With Selection
Set c = .Find(What:="", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
If c Is Nothing Then Exit Sub
c.EntireRow.Select
Selection.Delete Shift:=xlUp
End With
limite = limite - 1
Loop Until limite = 0
Application.ScreenUpdating = true
End Sub
Bonne nuit
Message édité par seniorpapou le 03-02-2009 à 21:20:15