Parsing Paragraph that has ! ? ; ..

Ceeyee

Board Regular
Joined
Feb 2, 2011
Messages
164
I wrote a short program to delete all sentences in a paragraph that contains certain words.
After I finished I found that it can only handle sentences ending with . but I don't know how to make it also work for ! ? ; etc.

My problem is that split() only takes one delimitor. Can any one give me some ideas on how to do multiple delimitors to break a paragraph? Thanks.


Function RMNumS(desc As String)

Dim d As Variant, desc2 As String
Dim i As Long

d = Split(desc, ".")

For i = 0 To UBound(d)

If InStr(d(i), "a") = 0 Then
desc2 = desc2 & d(i) & ". "
End If

Next i

RMNumS = desc2

End Function
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
You could first replace all those other punctuation marks with periods.
 
Upvote 0
but if that sentence is not to be deleted then the punctuation mark will be forgotten and everything will be period.
 
Upvote 0
Can you provide some examples of what you're doing?
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top