#1   Report Post  
Doug Robbins
 
Posts: n/a
Default No more than 15

The following code in a macro will do what you want

Dim i As Long, myrange As Range, j As Long
For i = 1 To ActiveDocument.Paragraphs.Count
j = InStr(ActiveDocument.Paragraphs(i).Range.Text, "=")
If j 16 Then
Set myrange = ActiveDocument.Paragraphs(i).Range
myrange.End = myrange.Start + j - 1
myrange.Text = Left(myrange.Text, 15)
End If
Next i


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"Steved" wrote in message
...
Hello from Steved

The Boy Can Sing= by Danehill,$1,345


The Boy Can Sin= by Danehill,$1,345

The objective please is to have a formula
that will search the entire document and
Any word or words longer than 15 includes spaces
after 15 to be deleted to leave as above, anythinh after
the = does not matter in other words it can be as long as
it needs to be. It is only before the = sign that I need a
formula for please.

Thankyou.



  #2   Report Post  
Steved
 
Posts: n/a
Default

Thankyou.
-----Original Message-----
The following code in a macro will do what you want

Dim i As Long, myrange As Range, j As Long
For i = 1 To ActiveDocument.Paragraphs.Count
j = InStr(ActiveDocument.Paragraphs

(i).Range.Text, "=")
If j 16 Then
Set myrange = ActiveDocument.Paragraphs(i).Range
myrange.End = myrange.Start + j - 1
myrange.Text = Left(myrange.Text, 15)
End If
Next i


--
Please respond to the Newsgroup for the benefit of

others who may be
interested. Questions sent directly to me will only be

answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"Steved" wrote in

message
...
Hello from Steved

The Boy Can Sing= by Danehill,$1,345


The Boy Can Sin= by Danehill,$1,345

The objective please is to have a formula
that will search the entire document and
Any word or words longer than 15 includes spaces
after 15 to be deleted to leave as above, anythinh

after
the = does not matter in other words it can be as long

as
it needs to be. It is only before the = sign that I

need a
formula for please.

Thankyou.



.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:29 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"