Eliminating rows of data in excel spreadsheet that have blank cell in row A and data in row B - E

  • Thread starter Steven R. Berke
  • Start date
S

Steven R. Berke

I have several rows of data at the bottom of an excel file that I want
to delete. These rows consist of 5 columns of data but in the case of
the rows I want to delete there is no data in cell A. This feature
only exists in the cells of the rows I want to delete all the other
rows have data in column "A". What I need is a macro that will delete
the rows that have blank cells in row "A" but have data in row "B"
thru "E".
 
B

Bob Kilmer

Steven,
If you want to delete all rows in the active worksheet that have a blank
cell in column A, this will do it.

Activesheet.Columns("A").SpecialCells(xlBlanks).EntireRow.Delete xlShiftUp

If you want to operate on a particular workbook, whether or not it is
active, this will do it.

Workbooks("Book1.xls").Worksheets("Sheet1").Columns("A").SpecialCells(xlBlan
ks).EntireRow.Delete xlShiftUp

If you want to operate on a worksheet in the workbook where the code
resides, this will do it.

This
workbook.Worksheets("Sheet1").Columns("A").SpecialCells(xlBlanks).EntireRow.
Delete xlShiftUp


Bob Kilmer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top