View Single Post
 
Old 01-16-2011, 09:13 PM
Michael007 Michael007 is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Dec 2010
Posts: 18
Michael007 is on a distinguished road
Default keep only sentences beginning with: Wind

Hi everyone,

I am a beginner with VBA. I wonder if it is possible with a VBA to keep in a long text, only the sentences beginning with the words: "Wind" or "Donaway" or "Sagway". If yes, could you write a piece of VBA, pls.

For instance, in the following text:
=====
Donaway to Isle-Icer - eastern half.
Winds southwest 15 to 25 knots diminishing to light this evening. Wind increasing to northeast 20 to 30 near noon saturday. Periods of drizzle and occasional fog turning to snow tonight. Low tonight minus 1. High Saturday plus 2.

Sagway to Tadouvik.
Gale warning in effect.
Wind light becoming east 10 to 15 knots early this evening then diminishing to light near midnight.Wind increasing to east 15 to 25 near noon Saturday and to 25 to 35 Saturday evening. Risk of freezing drizzle late this afternoon.
====

I wish to keep only
====
Donaway to Isle-Icer - eastern half.
Wind southwest 15 to 25 knots diminishing to light early this evening and to light near midnight. Wind increasing to northeast 15 to 25 near noon Saturday.

Sagway to Tadouvik.
Wind light becoming east 10 to 15 knots early this evening thendiminishing to light near midnight. Wind increasing to east 15 to25 near noon Saturday and to 25 to 35 Saturday evening.
=========


Thanks for your help
Michael
Reply With Quote