Delete rows if particular cell empty

  • Thread starter Thread starter Code Numpty
  • Start date Start date
C

Code Numpty

I need to include an instruction in a macro to delete rows, based on one cell
being empty.

If cell c10 (range name = "deliver_line1") is empty, then I want to delete
rows 10 to 15 (range name = "deliver_rows).

I have used
Range("Item_Nos").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
elsewhere, but this must relate to a cell which is not the first in the row.

Grateful for any help, thanks.
 
If IsEmpty(Range("deliver_line1")) Then
Sheets(1).Rows("10:15").EntireRow.Delete
End If
 
Thanks Dom, I had to tweak it a bit to.....

If IsEmpty(Range("deliver_line1")) _
Then Sheets(1).Range("deliver_rows").EntireRow.Delete

When I first tried your code, it produced a compile error. No End If is
required as there is only one action as a result of the If, (apparently).
 
Back
Top