Hi All
I am using Excel 2003 (SP2).
If a particular cell in my worksheet is blank, then the entire row will be blank and I wish to delete it. I found the following line of code posted by anotherhiggins in a separate thread:
which would quite rightly delete the entire row where a blank cell was found in column A. The twist in my problem is that I have a couple of columns that I wish to do this with, one of which is further across the worksheet. I do not wish to delete the entire row in this case as there may be data in the preceding columns. In this case, I would like to delete the row from the searched column to the end of the row, and shift the remaining rows up. I know how to do the upward shift once the row is deleted e.g.
but I think the trick lies in identifying the row number of the blank cell, and I'm not sure how to retrieve that.
Can someone point me in the right direction?
Many Thanks
Geraint
The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy
I am using Excel 2003 (SP2).
If a particular cell in my worksheet is blank, then the entire row will be blank and I wish to delete it. I found the following line of code posted by anotherhiggins in a separate thread:
anotherhiggins said:Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
which would quite rightly delete the entire row where a blank cell was found in column A. The twist in my problem is that I have a couple of columns that I wish to do this with, one of which is further across the worksheet. I do not wish to delete the entire row in this case as there may be data in the preceding columns. In this case, I would like to delete the row from the searched column to the end of the row, and shift the remaining rows up. I know how to do the upward shift once the row is deleted e.g.
Range("E3:IV3").Delete Shift:=xlUp
but I think the trick lies in identifying the row number of the blank cell, and I'm not sure how to retrieve that.
Can someone point me in the right direction?
Many Thanks
Geraint
The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy