Deleting blank rows

T

tat

I am copying a file from a different program into excel.
Then I am am using the text to columns to convert the
information to columns in excel. When I do this, there are
blank lines inserted after each record so in actuality it
is double spaced. How do I get rid of these blank rows? I
would like to use a macro that would do this no matter how
many rows of data there are. (Sometimes there will be 50
rows, sometimes there will be 100 etc.)
 
P

Paul B

Tat, try something like this

Sub Delete_blank()
'Will delete the whole row where there are blank cells in A1:A200
[A1:A200].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 **
 
T

Tat

Thanks, that worked very well. When I have some time I'll
look at the other suggestions that were posted for this
problem.

Have a great day!
-----Original Message-----
Tat, try something like this

Sub Delete_blank()
'Will delete the whole row where there are blank cells in A1:A200
[A1:A200].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 **
I am copying a file from a different program into excel.
Then I am am using the text to columns to convert the
information to columns in excel. When I do this, there are
blank lines inserted after each record so in actuality it
is double spaced. How do I get rid of these blank rows? I
would like to use a macro that would do this no matter how
many rows of data there are. (Sometimes there will be 50
rows, sometimes there will be 100 etc.)


.
 

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