Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Rudy Rudy is offline
external usenet poster
 
Posts: 17
Default how to search delete more than one characters in a document

I use search & replace to delete a charachter in a document and it works fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!

  #2   Report Post  
Posted to microsoft.public.word.newusers
Pranav Vaidya[_2_] Pranav Vaidya[_2_] is offline
external usenet poster
 
Posts: 59
Default how to search delete more than one characters in a document

I think you want to use the REPLACE ALL option on the Find & Replace window.

--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"Rudy" wrote:

I use search & replace to delete a charachter in a document and it works fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!

  #3   Report Post  
Posted to microsoft.public.word.newusers
Terry Farrell Terry Farrell is offline
external usenet poster
 
Posts: 2,904
Default how to search delete more than one characters in a document

I'm guessing from your question that these are non-contiguous characters?
That may be difficult. Would you describe what you are trying to delete
using S&R please and mention the version of Word please?

--
Terry Farrell - MS Word MVP

"Rudy" wrote in message
...
I use search & replace to delete a charachter in a document and it works
fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!


  #4   Report Post  
Posted to microsoft.public.word.newusers
Rudy Rudy is offline
external usenet poster
 
Posts: 17
Default how to search delete more than one characters in a document



"Terry Farrell" wrote:

I'm guessing from your question that these are non-contiguous characters?
That may be difficult. Would you describe what you are trying to delete
using S&R please and mention the version of Word please?

--
Terry Farrell - MS Word MVP

"Rudy" wrote in message
...
I use search & replace to delete a charachter in a document and it works
fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!

these are the charachters i'm trying to delete: ß,Û,Þ etc.

I'm using word 2003.
  #5   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default how to search delete more than one characters in a document

Enter the characters in an array either by their ANSI number or as
characters (both shown below) then run the macro to remove them. If you need
to remove trailing space or punctuation then you'll need to add it between
the quotes.

Sub ReplaceList()
Dim vFindText As Variant
Dim i As Long

'vFindText = Array(Chr(223), Chr(219), Chr(222))
vFindText = Array("ß", "Û", "Þ")

With Selection
.HomeKey Unit:=wdStory
With .Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True

For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
Next i
End With
End With
End Sub

http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rudy wrote:
"Terry Farrell" wrote:

I'm guessing from your question that these are non-contiguous
characters? That may be difficult. Would you describe what you are
trying to delete using S&R please and mention the version of Word
please?

--
Terry Farrell - MS Word MVP

"Rudy" wrote in message
...
I use search & replace to delete a charachter in a document and it
works fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!

these are the charachters i'm trying to delete: ß,Û,Þ etc.

I'm using word 2003.





  #6   Report Post  
Posted to microsoft.public.word.newusers
Rudy Rudy is offline
external usenet poster
 
Posts: 17
Default how to search delete more than one characters in a document

I did not suspect that I would get such good results and so fast. Thank you
very much.

"Graham Mayor" wrote:

Enter the characters in an array either by their ANSI number or as
characters (both shown below) then run the macro to remove them. If you need
to remove trailing space or punctuation then you'll need to add it between
the quotes.

Sub ReplaceList()
Dim vFindText As Variant
Dim i As Long

'vFindText = Array(Chr(223), Chr(219), Chr(222))
vFindText = Array("ß", "Û", "Þ")

With Selection
.HomeKey Unit:=wdStory
With .Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True

For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
Next i
End With
End With
End Sub

http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rudy wrote:
"Terry Farrell" wrote:

I'm guessing from your question that these are non-contiguous
characters? That may be difficult. Would you describe what you are
trying to delete using S&R please and mention the version of Word
please?

--
Terry Farrell - MS Word MVP

"Rudy" wrote in message
...
I use search & replace to delete a charachter in a document and it
works fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!

these are the charachters i'm trying to delete: ß,Û,Þ etc.

I'm using word 2003.




  #7   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default how to search delete more than one characters in a document

You are welcome

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rudy wrote:
I did not suspect that I would get such good results and so fast.
Thank you very much.

"Graham Mayor" wrote:

Enter the characters in an array either by their ANSI number or as
characters (both shown below) then run the macro to remove them. If
you need to remove trailing space or punctuation then you'll need to
add it between the quotes.

Sub ReplaceList()
Dim vFindText As Variant
Dim i As Long

'vFindText = Array(Chr(223), Chr(219), Chr(222))
vFindText = Array("ß", "Û", "Þ")

With Selection
.HomeKey Unit:=wdStory
With .Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True

For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
Next i
End With
End With
End Sub

http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rudy wrote:
"Terry Farrell" wrote:

I'm guessing from your question that these are non-contiguous
characters? That may be difficult. Would you describe what you are
trying to delete using S&R please and mention the version of Word
please?

--
Terry Farrell - MS Word MVP

"Rudy" wrote in message
...
I use search & replace to delete a charachter in a document and it
works fine.
I would like to delete several characters at the same time.
How can I do that??? Please HELP!!

these are the charachters i'm trying to delete: ß,Û,Þ etc.
I'm using word 2003.



  #8   Report Post  
Posted to microsoft.public.word.newusers
fumei via OfficeKB.com fumei via OfficeKB.com is offline
external usenet poster
 
Posts: 6
Default how to search delete more than one characters in a document

Or, to not use Selection - generally not a good idea as Range is better - you
could use:

Sub Change()
Dim vFindText
Dim r As Range
Dim i As Long
vFindText = Array("f", "g", "d")
For i = 0 To UBound(vFindText)
Set r = ActiveDocument.Range
With r.Find
.Text = vFindText(i)
Do While .Execute(Forward:=True) = True
r.Delete
Loop
End With
Next
End Sub

Which deletes all the characters in the given array, in this case "f", "g",
and "d".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/200709/1

  #9   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default how to search delete more than one characters in a document

That's all very well, until you want to run the macro on only part of the
text, when the whole document range will not cut it

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



fumei via OfficeKB.com wrote:
Or, to not use Selection - generally not a good idea as Range is
better - you could use:

Sub Change()
Dim vFindText
Dim r As Range
Dim i As Long
vFindText = Array("f", "g", "d")
For i = 0 To UBound(vFindText)
Set r = ActiveDocument.Range
With r.Find
.Text = vFindText(i)
Do While .Execute(Forward:=True) = True
r.Delete
Loop
End With
Next
End Sub

Which deletes all the characters in the given array, in this case
"f", "g", and "d".



Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to search/replace symbol characters MichaelG Microsoft Word Help 5 April 26th 06 05:41 PM
Search and replace with special characters Bob Microsoft Word Help 1 March 6th 05 10:44 PM
Search and Invisible Characters? Joseph McGuire Microsoft Word Help 3 March 4th 05 05:06 AM
Search & Replace larger than 255 characters Sally B Microsoft Word Help 0 January 26th 05 04:51 PM
search and replace symbol characters Patricia G. Kurz Microsoft Word Help 1 December 29th 04 03:11 AM


All times are GMT +1. The time now is 08:48 AM.

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"