ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete rows if particular cell empty (https://www.excelbanter.com/excel-programming/406908-delete-rows-if-particular-cell-empty.html)

Code Numpty

Delete rows if particular cell empty
 
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).E ntireRow.Delete
elsewhere, but this must relate to a cell which is not the first in the row.

Grateful for any help, thanks.

DomThePom

Delete rows if particular cell empty
 
If IsEmpty(Range("deliver_line1")) Then
Sheets(1).Rows("10:15").EntireRow.Delete
End If

"Code Numpty" wrote:

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).E ntireRow.Delete
elsewhere, but this must relate to a cell which is not the first in the row.

Grateful for any help, thanks.



All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com