Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2012, 12:15 PM
lostsoul62's Avatar
lostsoul62 lostsoul62 is offline Deleting empty lines Windows 7 64bit Deleting empty lines Office 2010 64bit
Advanced Beginner
Deleting empty lines
 
Join Date: Dec 2011
Posts: 48
lostsoul62 is on a distinguished road
Default Deleting empty lines

Is there any way to delete any empty line? I have a thousand words on every other line so is there any way to delete them so my words will be together and not space apart?

Reply With Quote
  #2  
Old 04-15-2012, 12:38 PM
Charles Kenyon Charles Kenyon is online now Deleting empty lines Windows Vista Deleting empty lines Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by lostsoul62 View Post
Is there any way to delete any empty line? I have a thousand words on every other line so is there any way to delete them so my words will be together and not space apart?
Are you saying that you have a thousand paragraphs in Word with one word in each?

(You create a new paragraph each time you press the Enter key when typing.)

If so, select all your text (Ctrl-A) then format you paragraphs for no space between paragraphs.
Reply With Quote
  #3  
Old 04-15-2012, 01:48 PM
lostsoul62's Avatar
lostsoul62 lostsoul62 is offline Deleting empty lines Windows 7 64bit Deleting empty lines Office 2010 64bit
Advanced Beginner
Deleting empty lines
 
Join Date: Dec 2011
Posts: 48
lostsoul62 is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Are you saying that you have a thousand paragraphs in Word with one word in each?
This came from an email with a thousand lines with a word in every other line I got rid of all the > with a word replace. I use to see this in a lot of old emails so I copy it over to Word to see if I can fix it.

(You create a new paragraph each time you press the Enter key when typing.)
I think Word might think that

If so, select all your text (Ctrl-A) then format you paragraphs for no space between paragraphs.
I'm not sure how to format the paragraphs for no space between the paragraphs?
Reply With Quote
  #4  
Old 04-15-2012, 03:10 PM
Charles Kenyon Charles Kenyon is online now Deleting empty lines Windows Vista Deleting empty lines Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

On the Home tab ribbon in the paragraph group, click on the dialog box launcher (bottom right corner of group).

Where it says space before and space after you want 0. Where it has line spacing, you want single.
Reply With Quote
  #5  
Old 04-15-2012, 04:48 PM
lostsoul62's Avatar
lostsoul62 lostsoul62 is offline Deleting empty lines Windows 7 64bit Deleting empty lines Office 2010 64bit
Advanced Beginner
Deleting empty lines
 
Join Date: Dec 2011
Posts: 48
lostsoul62 is on a distinguished road
Default

Because this email was formatted to have a space between each line giving me data on every other line this doesn't work because Word is treating the space as data. I thought there might be a way. The Find and Replace should work but I can't find a way. If only I could enter a find of nothing except the blink line and replace it with a delete. Pretty complicated stuff and I'm not sure how many people know how to do this but there must be a way.
Reply With Quote
  #6  
Old 04-16-2012, 04:55 AM
macropod's Avatar
macropod macropod is offline Deleting empty lines Windows 7 64bit Deleting empty lines Office 2010 32bit
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 lostsoul62,

The following macro cleans up text pasted from emails, websites, etc, that insert paragraph breaks at the end of every line. Note that the code assumes there are at least two such paragraph breaks between the 'real' paragraphs.
Code:
Sub CleanUpPastedText()
'Turn Off Screen Updating
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Forward = True
  .Wrap = wdFindStop
  .Format = False
  .MatchAllWordForms = False
  .MatchSoundsLike = False
  .MatchWildcards = True
  'Eliminate spaces & tabs before paragraph breaks.
  .Text = "[ ^s^t]{1,}^13"
  .Replacement.Text = "^p"
  .Execute Replace:=wdReplaceAll
  'Replace single paragraph breaks & line breaks with a space
  .Text = "([!^13^l])([^13^l])([!^13^l])"
  .Replacement.Text = "\1 \3"
  'Replace all double spaces with single spaces
  .Execute Replace:=wdReplaceAll
  .Text = "[^s ]{2,}"
  .Replacement.Text = " "
  'Delete hypens in hyphenated text formerly split across lines
  .Execute Replace:=wdReplaceAll
  .Text = "([a-z])-[ ]{1,}([a-z])"
  .Replacement.Text = "\1\2"
  .Execute Replace:=wdReplaceAll
  'Limit paragraph breaks & line breaks to one paragraph break per 'real' paragraph.
  .Text = "[^13^l]{1,}"
  .Replacement.Text = "^p"
  .Execute Replace:=wdReplaceAll
End With
'Restore Screen Updating
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html

If you'd prefer to run the macro against just a selected range, change:
ActiveDocument
to:
Selection
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting empty lines Word Empty Cells - Why is it Chr(13) & Chr(7) tinfanide Word VBA 2 04-10-2012 01:34 AM
Apparently empty (blank) cells aren't empty daymaker Excel 3 03-08-2012 03:41 PM
Deleting empty lines Getting blank lines instead of supressed lines. Welshie82 Mail Merge 2 11-14-2011 01:41 AM
Deleting empty lines Empty rules rene.kamphuis@ciz.nl Mail Merge 21 04-15-2011 12:34 AM
Populate an empty .PAB file imported_contiw Outlook 2 08-17-2006 08:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:14 AM.


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