Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete selected Rows if cells contain no data

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
US
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:

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.
 
This is an ExcelVBA issue, so please post here:
forum707
and then RedFlag this post asking the management to delete it.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top