Delete the same text on multiple pages

Hi experts!!!

Every day I work with a large word documents with over 100 pages. If I want to make my job easier, I need to reduce that page number and I was able to do that by deleting  header on every page. I was doing it manualy and it's a real pain in the ass. So I wanted to ask you, is there any easier - automatic - "built in word" way to do that? I tried to use find - replace option, but all I could manage to do is to replace those unnecessary text with unnecessary empty rows (I replaced header text with "space").
Is there any "find - delete" option in word?
For those of you who don't understand what I want, here is the example...

HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT                 HEADER TEXT HEADER TEXT             HEADER TEXT         HEADER TEXT HEADER TEXT HEADER TEXT            HEADER TEXT HEADER TEXT                        HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT
(Header text is not the same in every row, it consists of many numbers, dates, spaces, ... but it is the same on every page)

NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT

So, what I want is the way to clear HEADER TEXT from each page in the document, in order to reduce number of pages. I DON'T WANT TO REPLACE HEADER TEXT WITH BLANK ROWS since it doesn't reduce number of pages...


 THANKS!!!!
LVL 4
Da-BuAsked:
Who is Participating?
 
stengeljCommented:
I not a 100% sure what you are looking for, but let me offer this suggestion:

You mentioned find and replace did not work for you because it left the line breaks in.  Try this method again but this time do a find for "Header Text^p" and leave the replace area empty (no space).  The "^p" will include the line break between your header text and the needed text.  If there are two or more line breaks, just add additional "^p"s after the header text.

Let me know if this doesn't work and maybe you can email me a copy of the document so I can try something different.
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
You can always search and replace with nothing.
0
 
Anne TroyEast Coast ManagerCommented:
Here's what I do.
Likely, there's some coder here who could tell you how to loop the code, but it ain't me. :)

Record a macro that does this:

Ctrl+F
Type in the first word or character in the area that you wanna delete. Make sure it's a unique string long enough so it doesn't find something you DON'T want to delete.
Then hit Find now.
Then close the find box.
Then hit your left arrow key one time. Your cursor is at the left of the text you wanna delete.
Then hit the EXT in Word's status bar.
Now Ctrl+F again.
Type the unique string that's at the END of the area you wanna remove.
Hit Find now.
Close the Find box.
Your desired text to delete should be selected.
Hit Delete.
Stop recording.

Run the macro again and again, or paste the code here and ask some poor macro coder with a great heart to write the code that'll loop it for you. Or maybe Jo knows! :)
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Eric FletcherCommented:
Is the header text within a table? Your description makes me think that maybe it is, and if so, Find & Replace will not work so well. If it is the only material in tables, you could use "Browse by table" option in the flyout menu from the round button at the bottom of the vertical scroll bar, then delete the found table. Here's what it might look like recorded:

Sub CutNextTableBlindly()
    Application.Browser.Target = wdBrowseTable
    Application.Browser.Next
    Selection.Tables(1).Select
    Selection.Cut
End Sub

If you assigned it to a button, it would find and cut the next table each time. If you wanted it to do the entire document, you'd need to enclose the code above in a loop.

But don't use this approach if the document has other tables within it or you'll lose all of them too.

If the tables consistently contain the header text AND are within tables, you could use Find to find the next instance of the text, then select the table and cut it -- essentially, replace the Application.Browser lines above with the recorded version of a Find with your header text as target.
0
 
EkaterinCommented:
Firstly - check out the special tab at the bottom of the Find-Replace dialog. If you can't see it, hit the More button.

You can enter sepcial characters into the Find What box to deal with text in rows. For example if you have

Header Text
Header Text

Then I would search for

     'Header Text^w^pHeaderText'

and replace it with nothing - a totally blank Replace with box.

To decrypt the search string the ^w adds in any amount of white space - useful if you have a couple of spaces at the end of a line which you don't know about.The ^p is a paragraph mark - telling word that the text is on two lines, and you want to get rid of both lines.

If you want to get rid of the line where the last Header Text is on, then add another ^w^p at the end of the search string, to remove the line alltogether.

Hope this helps

    Ekaterin
0
 
Da-BuAuthor Commented:
Hi all!

The solution from STENGELJ was THE ONE, but I'm also giving points to DREAMBOAT for the insight in MACROS...

Thanks all!!!
0
 
Anne TroyEast Coast ManagerCommented:
Thanks, Da-Bu!
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.