Imported file - Delete Blank Rows

Muddypaws

New Member
Joined
Dec 3, 2009
Messages
28
Hi

I have imported a file of data and every so often there is a blank row (and there is a lot of them). How do I delete in one go the blank rows, trying to avoid right clicking every line then "delete row"

I am using Excel 2007

Thanks
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Hi. Try this

Code:
Sub DelBl()
On Error Resume Next
Columns("A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
End Sub
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Press ALT + F11 to open the Visual Basic Editor, select Module from the Insert menu and post the code into the white space on the right. Press ALT + Q.

Press ALT + F8, click on DelBl and click the Run button.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,612
Messages
5,523,891
Members
409,542
Latest member
Shezz01

This Week's Hot Topics

Top