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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete entire blank row between filled rows

Status
Not open for further replies.

grafidi

Technical User
Apr 30, 2003
1
US
I have a file in excel contains 1200 records and there one or two line blank between each one. does any body know how to delete these blank line in excel 2000?
 
If this is a one-time thing, just sort the data and the blank rows will fall to the bottom.
 
if it's not a one off or sorting isn't appropriate (for whatever reason) then this'll do it

Code:
Sub it()
Dim lRow As Long
For lRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
    If WorksheetFunction.CountA(Rows(lRow).Cells) = 0 Then
        Rows(lRow).EntireRow.Delete
    End If
Next
End Sub
;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top