Find & Replace Macro

N

Neal

I have a text document (that I can open in Word) that I need to do a Find &
Replace on 9624 records. The same words appear at the start of each record.
I need to do a Find on those words, and then replace the word with 20 'Manual
Returns' and the original words. In short, I need to add 20 blank lines
between each record. Is there an easy way to do this? Any help would be
greatly appreciated. Thank you!!
 
B

Bear

Neal:

You should be able to do this with Find & Replace, without recourse to VBA.

Find: Xxxx
Replace with: ^p^p^p^p ... ^p^p^pXxxx

The elipses are mine -- you'd actually enter ^p twenty times.

If that's too much for you or Word, put a unique character in front of the
text, then replace that character with five or ten returns at a time.

Find: Xxxx
Replace with: [@]Xxxx

The "[@]" is exactly what I'd enter, as it provides a unique but easily
recognizable marker. Then,

Find: [@]
Replace with: ^p^p^p^p^p^p^p^p^p^p[@]

Do that twice, then remove the special mark by replacing it with nothing.

Find: [@]
Replace with:

Bear
 
N

Neal

Thank you so much!! This worked perfectly!! Thank you!!

Bear said:
Neal:

You should be able to do this with Find & Replace, without recourse to VBA.

Find: Xxxx
Replace with: ^p^p^p^p ... ^p^p^pXxxx

The elipses are mine -- you'd actually enter ^p twenty times.

If that's too much for you or Word, put a unique character in front of the
text, then replace that character with five or ten returns at a time.

Find: Xxxx
Replace with: [@]Xxxx

The "[@]" is exactly what I'd enter, as it provides a unique but easily
recognizable marker. Then,

Find: [@]
Replace with: ^p^p^p^p^p^p^p^p^p^p[@]

Do that twice, then remove the special mark by replacing it with nothing.

Find: [@]
Replace with:

Bear

Neal said:
I have a text document (that I can open in Word) that I need to do a Find &
Replace on 9624 records. The same words appear at the start of each record.
I need to do a Find on those words, and then replace the word with 20 'Manual
Returns' and the original words. In short, I need to add 20 blank lines
between each record. Is there an easy way to do this? Any help would be
greatly appreciated. Thank you!!
 
C

CS Hayes

[@] would work great unles the user has email address in his text...

oh, wouldn't that be a mess
--
Chris Hayes
Still a beginner (only 12 years)


Bear said:
Neal:

You should be able to do this with Find & Replace, without recourse to VBA.

Find: Xxxx
Replace with: ^p^p^p^p ... ^p^p^pXxxx

The elipses are mine -- you'd actually enter ^p twenty times.

If that's too much for you or Word, put a unique character in front of the
text, then replace that character with five or ten returns at a time.

Find: Xxxx
Replace with: [@]Xxxx

The "[@]" is exactly what I'd enter, as it provides a unique but easily
recognizable marker. Then,

Find: [@]
Replace with: ^p^p^p^p^p^p^p^p^p^p[@]

Do that twice, then remove the special mark by replacing it with nothing.

Find: [@]
Replace with:

Bear

Neal said:
I have a text document (that I can open in Word) that I need to do a Find &
Replace on 9624 records. The same words appear at the start of each record.
I need to do a Find on those words, and then replace the word with 20 'Manual
Returns' and the original words. In short, I need to add 20 blank lines
between each record. Is there an easy way to do this? Any help would be
greatly appreciated. Thank you!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top