View Single Post
 
Old 06-03-2011, 02:24 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi brad,
Quote:
This deletes some empty rows but leaves some. Can it be tweaked to get them all?
Your premise is wrong and no tweaking is required to delete all empty rows. I suspect you've got either hidden hidden text or non-printing characters such as spaces in the rows that aren't being deleted - in which case, they're not empty.

You could deal with ordinary spaces by changing:
If Len(.Rows(i).Range.Text) = .Rows(i).Cells.Count * 2 + 2 Then .Rows(i).Delete
to:
If Replace(Len(.Rows(i).Range.Text)," ","") = .Rows(i).Cells.Count * 2 + 2 Then .Rows(i).Delete
but even this won't delete rows with just non-breaking spaces, tabs, paragraph breaks, etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote