Hello All,
I'm trying to delete the entire row of a range if any cell in column "A" is empty, blank or appears to be blank. These are all supposed to be strings of last names but when I enter "=ISBLANK(A2) " in the cell the result is False, therefore it's not blank and .SpecialCells(xlCellTypeBlanks).EntireRow.Delete fails.
Is there a way to delete if the cell does not contain any text. aka last name?
I was thinking
With Worksheets("Sheet2").UsedRange
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete Shift:=xlUp
End With
But as mentioned, it's not deleting rows as cells are not blank. I'd like to know what's in the cell but that's just for my own education
Strangely the macro:
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete shift:=xlUp
Does delete some of them but not all
As it left these...(below Mike Smith)
I also don't want to use "Select".
Does anyone have an idea to delete all rows in a range where "A" contains no last name but =ISBLANK(A2) is returning false?
Thanks!
I'm trying to delete the entire row of a range if any cell in column "A" is empty, blank or appears to be blank. These are all supposed to be strings of last names but when I enter "=ISBLANK(A2) " in the cell the result is False, therefore it's not blank and .SpecialCells(xlCellTypeBlanks).EntireRow.Delete fails.
Is there a way to delete if the cell does not contain any text. aka last name?
I was thinking
With Worksheets("Sheet2").UsedRange
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete Shift:=xlUp
End With
But as mentioned, it's not deleting rows as cells are not blank. I'd like to know what's in the cell but that's just for my own education
Strangely the macro:
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete shift:=xlUp
Does delete some of them but not all
As it left these...(below Mike Smith)
Lastname | FirstName | Type | Date | Number | |
Smith | Mike | Student | Jun 19-20 | something@somewhere | 1233 |
Student | Jul 29-20 | ||||
Student | Jun 19-20 | ||||
Student | Jul 29-20 |
I also don't want to use "Select".
Does anyone have an idea to delete all rows in a range where "A" contains no last name but =ISBLANK(A2) is returning false?
Thanks!