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.