Deleting blank rows

  • Thread starter Thread starter tat
  • Start date Start date
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.)
 
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 **
 
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.)


.
 
Back
Top