Is there a easy way to delete blank lines to clean up worksheets?

J

jdf5

I have a workbook that break down a list of accounts based on differ factors
& then puts them onto different worksheets. After it does this is leaves
blank lines on the worksheets. Is there an easy way to delete the blank
lines?
 
R

Ron de Bruin

Hi jdf5

Can you test one column for blanks ?
http://www.rondebruin.nl/specialcells.htm


Or must you check whole rows ?
http://www.rondebruin.nl/delete.htm

Use this then in the code example

You must replace this five lines with the example below you want to use.

If IsError(.Cells(Lrow, "A").Value) Then
'Do nothing, This avoid a error if there is a error in the cell
ElseIf .Cells(Lrow, "A").Value = "ron" Then .Rows(Lrow).Delete
'This will delete each row with the Value "ron" in Column A, case sensitive.
End If


If Application.CountA(.Rows(Lrow)) = 0 Then .Rows(Lrow).Delete
'This will delete the row if the whole row is empty (all columns)
 
R

Ron de Bruin

Btw : manual you can select the column that you want to check and use
F5>Special
Blanks
Ctrl -
Choose entire row
 
Top