+ Reply to Thread
Results 1 to 5 of 5

Remove a specific word line from a word document.

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    Kelowna, Canada
    MS-Off Ver
    2013
    Posts
    2

    Remove a specific word line from a word document.

    Hi everyone, it's my first post here.

    I got a text document, which contains names, IDs and date. And I want to remove all the dates mentioned in it.

    Example:
    John Gates 137756
    Thursday 16:40
    Bill Graham 156811
    Thursday 20:25

    ...

    Is it possible to make a macro which does that, because I tried to do that manually but there are thousands of entries, so if it's possible to do that, using macros which would find the word-line Thursday and delete that line completely.

    Any help appreciated,
    Thanks.
    PS: Hope not breaking any of the forum rules, tried to read some of them

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Remove a specific word line from a word document.

    Try this sheet. Run the macro from the menu.

    Note this will delete every line that contains the word Thursday, whether it is the first word or not.
    Attached Files Attached Files
    My approach to providing help is to help you to help yourself. So my answers won't always solve your problem, but hopefully you can learn enough to solve the problem yourself and be more self sufficient for the experience.

  3. #3
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,832

    Re: Remove a specific word line from a word document.

    You can do this without a macro, using a wildcard Find/Replace, where:
    Find = Thursday[!^013^l]{1,}[^013^l]
    Replace = nothing
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Registered User
    Join Date
    05-25-2013
    Location
    Kelowna, Canada
    MS-Off Ver
    2013
    Posts
    2

    Cool Re: Remove a specific word line from a word document.

    @Mallycat & macropod: Thanks a lot guys, both of your methods worked great, and you saved me a lot of time!

    Thanks again.

  5. #5
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Remove a specific word line from a word document.

    macropod, can you please explain the codes you posted. Is there is list of these somewhere?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1