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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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)
 
Btw : manual you can select the column that you want to check and use
F5>Special
Blanks
Ctrl -
Choose entire row
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top