Thread: Delete text
View Single Post
 
Old 12-31-2010, 01:27 PM
Michael007 Michael007 is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Dec 2010
Posts: 18
Michael007 is on a distinguished road
Default Delete text

Hi everyone,

I am a beginner with VBA. I wonder if it is possible with a VBA to delete the text in a paragraph when a specific word is met. If yes, could you write a piece of VBA, pls.

For example, in the following text:
====
Wind southwest 10 to 20 knots becoming light early this evening.
Periods of drizzle and fog beginning this evening changing to a few
showers near noon Saturday.

Wind light. Periods of drizzle and fog patches beginning early this
evening changing to showers Saturday afternoon.
=====

I wish to delete the text from "Periods" to the end of the paragraph for both paragraph in order to get this result:
====
Wind southwest 10 to 20 knots becoming light early this evening.

Wind light.
=====

Of course, you guess that my real text is much longer than that!
Thanks
Michael
Reply With Quote