Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to search/replace symbol characters | Microsoft Word Help | |||
Search and replace with special characters | Microsoft Word Help | |||
Search and Invisible Characters? | Microsoft Word Help | |||
Search & Replace larger than 255 characters | Microsoft Word Help | |||
search and replace symbol characters | Microsoft Word Help |