Remove empty rows in excel?

G

Guest

I have edited an excel worksheet by deleting rows of info. How do I get rid
of the empty rows
 
R

Ron de Bruin

Hi Clbmgr

You can't delete the rows, but you can hide them if you want
Select the rows and in the menubar

Format>Row>Hide

Or
Ctrl -
 
G

Guest

Try this macro:




Public Sub DeleteBlankRows()

Dim R As Long
Dim C As Range
Dim Rng As Range

On Error GoTo EndMacro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

If Selection.Rows.Count > 1 Then
Set Rng = Selection
Else
Set Rng = ActiveSheet.UsedRange.Rows
End If
For R = Rng.Rows.Count To 1 Step -1
If Application.WorksheetFunction.CountA(Rng.Rows(R).EntireRow) = 0 Then
Rng.Rows(R).EntireRow.Delete
End If
Next R

EndMacro:

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub



This will delete ALL completely blank rows in a workbook. If even one cell
contains info in the row it will not be deleted.

CHRISTOPHER
 
G

Gord Dibben

Do you mean you "cleared contents" on these rows and now you want to eliminate
the empty rows?

Select a column and F5>Special>Blanks>OK

Edit>Delete>Entire Row

Gord Dibben Excel MVP
 
D

Dave Peterson

Maybe you could just sort by a column that always has something in it if the row
is used.
 

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

Similar Threads

Delete empty rows 1
deleting empty rows 3
Deleting empty rows automatically 2
Cannot remove empty rows 8
Excel Moving data to sheet2 from sheet1 0
Easiest Way to Delete Rows 4
Delete Empty Rows 4
Deleting blank rows 4

Top