Deleting Rows Between Empty Cells

D

Daren

I have a large data set that I'm copying from Access into Excel. There are
blank rows between the data I want to analyze. Is there a way to quickly
delete these rows so I can have the date inn consecutive rows? Thanks.
 
R

Rick Rothstein

This macro should do what you want...

Sub DeleteBlankRows()
Rows.SpecialCells(xlCellTypeBlanks).Delete
End Sub

If you are not sure how to implement this, right click the worksheet tab you
want to use this on, select View Code from the popup menu that appears,
copy/paste the above into the code window that appears, click anywhere
inside the code you just pasted and press F5 to run it. All blank rows up to
and including those in the data itself should now be gone.
 
D

Duke Carey

Best to sort the data to put all the blank rows at the top of the bottom,
then delete them. Alternatively, go to Access and use a query to delete the
blank rows before you copy the data.
 
D

Daren

Thanks!

Rick Rothstein said:
This macro should do what you want...

Sub DeleteBlankRows()
Rows.SpecialCells(xlCellTypeBlanks).Delete
End Sub

If you are not sure how to implement this, right click the worksheet tab you
want to use this on, select View Code from the popup menu that appears,
copy/paste the above into the code window that appears, click anywhere
inside the code you just pasted and press F5 to run it. All blank rows up to
and including those in the data itself should now be gone.
 
D

Daren

Thanks.

Duke Carey said:
Best to sort the data to put all the blank rows at the top of the bottom,
then delete them. Alternatively, go to Access and use a query to delete the
blank rows before you copy the data.
 

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

Top