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
| Sub test()
Dim bEmpty As Boolean
Dim rCol As Range
Dim rLine As Range
Dim rCellCol As Range
Dim rCellRow As Range
Dim iLastLine
Dim iLastCol
iLastLine = 50
iLastCol = 30
Set rCol = Range([A1], Cells(iLastLine, 1))
For Each rCellCol In rCol
bEmpty = True
While bEmpty
Set rLine = Range(rCellCol.Offset(1, 0), rCellCol.Offset(1, iLastCol))
For Each rCellRow In rLine
If Not IsEmpty(rCellRow) Then
bEmpty = False
Exit For
End If
Next rCellRow
If bEmpty Then
rCellCol.Offset(1, 0).EntireRow.Delete
End If
Wend
Next rCellCol
End Sub |
Partager