Results 1 to 12 of 12
  1. #1
    New Lounger
    Join Date
    May 2016
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Delete the spaces before each line paragraph

    Hello dear folks,

    my paragraphs have a spaces before them:
    this is an example
    another example paragraphs
    again very annoying problem


    I would like them to be level to the start of the line so they become

    this is an example
    another example paragraphs
    again very annoying problem


    How do i remove these with a macro or a vba?
    - i tried to do it manually but its too much now pages and pages of these


    thank you

    lilly

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Lilly,

    Welcome to the Lounge as a new poster!

    It's a bit hard to tell what to do since we can't see exactly what is causing the spacing (spaces, tabs, indenting, etc.).

    If you could post a sample document (most helpful) or at a minimum turn on the viewing of special characters and post a screen shot which includes the ruler.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    New Lounger
    Join Date
    May 2016
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hello RetiredG,

    thank you all for having me

    I looked at it - its usually just a bunch of stuff copied and pasted from the internet.

    i turned on the P

    it showed the full stops

    ....................
    .....................

    white space before each line

    I know how to delete white space but not at the begining

    I looked at google and this annoying problem solution did not come up

    lilly

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Lilly,

    Ok if all you have is spaces it's a pretty easy process using Find & Replace.

    In the Find what: box place a Paragraph Mark from the Special button, followed by two spaces.
    In the Replace with: box just place a Paragraph Mark.

    Click the Replace All button, wash/rinse/repeat until you get the message 0 replacements made.
    Note: you will have to manually kill any spaces at the start of the document as there is no leading Paragraph Mark. You can also start with more than two spaces in the Find what box to save some iterations and then just reduce the number by 1 each time it tells you 0 replacements until you're down to two spaces and get 0 replacements then you're done.

    Sorry, almost forgot you'll also have to run one iteration with a single space following the paragraph mark.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. The Following 2 Users Say Thank You to RetiredGeek For This Useful Post:

    Charles Kenyon (2016-05-08),lilly (2016-05-07)

  6. #5
    New Lounger
    Join Date
    May 2016
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hello rg,

    my brother made me this

    with your info

    [code]
    Sub Macro1()

    '
    ' Macro1 Macro
    '
    '

    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = "^p "
    .Replacement.Text = "^p"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Execute Replace:=wdReplaceAll
    End Sub

    it does the job ok - so i suppose its much much better than doing it by hand now that was hurting my fingers all the tappings.

    I will see how i get on with this
    thank you for helping
    lilly

  7. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Try this: no macros required!!!
    Select the text, click on the paragraph centre alignment button, then click on the paragraph left alignment button.

    Another way, with just a single Find/Replace:
    Find =^p^w
    Replace = ^p
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  8. The Following 4 Users Say Thank You to macropod For This Useful Post:

    Charles Kenyon (2016-05-08),lilly (2016-05-07),Lugh (2016-05-20),RetiredGeek (2016-05-07)

  9. #7
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Paul,

    Cool!
    Joe Cool.gif
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  10. #8
    New Lounger
    Join Date
    May 2016
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hello my dears,

    thank you for assisting.
    It seemed like a petty thing but when you have 50 pages of this annoying text, that vexxed me to no end.

    I am new to the macros.

    thank you RG for the first help.

    Pauls aligning the paragraphs was so simple and effectively good

    I have 3 solutions now,

    thanks alot again

    lilly

    i'll be back soon
    see you soon

  11. #9
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts
    Charles Kyle Kenyon
    Madison, Wisconsin

  12. #10
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi Charles,

    The issue here seems to be just the space removal, not a complete clean-up; otherwise I'd have referred the OP to: http://www.msofficeforums.com/word/2...s-e-mails.html
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  13. #11
    5 Star Lounger Lugh's Avatar
    Join Date
    Jun 2010
    Location
    Indy
    Posts
    620
    Thanks
    166
    Thanked 77 Times in 68 Posts
    Quote Originally Posted by Charles Kenyon View Post
    Fyi Charles, your link is bad.
    Lugh.
    ~
    Windows 10 Pro x64 1607; Office 2016 (365 Home) x32; Win Defender, MBAM Pro

    ASRock H97 Anniversary; Xeon E3-1231V3 (like i7)
    Gigabyte GeForce GTX 970; 12GB Crucial DDR3 1600
    Logitech MX Master mouse; Roccat Isku kb

  14. #12
    Star Lounger Graham Mayor's Avatar
    Join Date
    Mar 2016
    Location
    Cyprus
    Posts
    68
    Thanks
    0
    Thanked 24 Times in 24 Posts
    Graham Mayor - Word MVP
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •