Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 06-03-2011, 02:24 PM
macropod's Avatar
macropod macropod is offline Macro to delete all empty rows from all tables Windows 7 32bit Macro to delete all empty rows from all tables Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete all empty rows from all tables Empty rules rene.kamphuis@ciz.nl Mail Merge 21 04-15-2011 12:34 AM
Macro to delete all empty rows from all tables Word Macro to search all tables silverspr Word VBA 3 04-02-2011 11:20 PM
delete email message via blackberry and have it delete on my pop3 and my outlook Iamthestorm Outlook 2 10-28-2010 12:21 AM
Macro to delete all empty rows from all tables I need a macro that removes background of many tables masa57 Word VBA 2 05-08-2010 07:34 AM
Automated "Macro" to delete Tags/Anchors field3 Word VBA 0 02-25-2009 02:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft