I need some VBA code that will delete entire rows in EXCEL if any of the cells that are selected in the row contain no data.
I have found various code on the net, but none of it works for me yet. For example:
This code does not work in Excel 2007.
I will be selecting columns A,B,C then running the code and want it to delete rows if any one of the colums have no data, even if the other columns have data.
I have found various code on the net, but none of it works for me yet. For example:
Code:
Sub DeleteBlankRows2()
'Deletes the entire row within the selection if some of the cells WITHIN THE SELECTION contain no data.
On Error Resume Next
Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
End Sub
This code does not work in Excel 2007.
I will be selecting columns A,B,C then running the code and want it to delete rows if any one of the colums have no data, even if the other columns have data.