deleting blank rows

  • Thread starter Thread starter Ryan H.
  • Start date Start date
R

Ryan H.

Hi,

Im trying to go through a whole excel worksheet and delete all the blank
(empty) rows and push up the data in between up with other data... is there
any function that does this? Something to make the worksheet compact.

Let me illustrate:

Before:
DSG FAF GSE HSS DGB
DVG F4F G7E H9S 3GB

HDS WEY DHF SGD SGE


GSE SDB CVR H3G HRQ


After:
DSG FAF GSE HSS DGB
DVG F4F G7E H9S 3GB
HDS WEY DHF SGD SGE
GSE SDB CVR H3G HRQ



Thank you
 
Ryan, see if this will help

Sub Delete_blank_Rows()
'Will delete the whole row where there are blank cells in A1:A50
[A1:A50].SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
works perfectly!! Thank you!!


Paul B said:
Ryan, see if this will help

Sub Delete_blank_Rows()
'Will delete the whole row where there are blank cells in A1:A50
[A1:A50].SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
Ryan H. said:
Hi,

Im trying to go through a whole excel worksheet and delete all the blank
(empty) rows and push up the data in between up with other data... is there
any function that does this? Something to make the worksheet compact.

Let me illustrate:

Before:
DSG FAF GSE HSS DGB
DVG F4F G7E H9S 3GB

HDS WEY DHF SGD SGE


GSE SDB CVR H3G HRQ


After:
DSG FAF GSE HSS DGB
DVG F4F G7E H9S 3GB
HDS WEY DHF SGD SGE
GSE SDB CVR H3G HRQ



Thank you
 

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