Reply
 
Thread Tools Display Modes
  #1   Report Post  
jaidinesh jaidinesh is offline
Junior Member
 
Posts: 0
Default how can we find and replace hyphen to endash within numbers

Hi Paul,

Kindly correct my code in below:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True
With Selection.Find
.Text = "([0-9])-([0-9])"
.Replacement.Text = "\1^=\3"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Before Run:55-66
After Run:556–6
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
Exclude numbers in parantheses using wildcard find and replace prkhan56 Formatting Long Documents 2 July 14th 11 08:01 PM
I would like to find and replace a list of words with numbers checkQ Microsoft Word Help 6 October 2nd 08 07:39 PM
Find & Replace Wildcard Expression for Ordinal Numbers binar Microsoft Word Help 1 July 27th 07 04:41 PM
find and replace NUMBERS Andy Tables 1 May 12th 07 08:50 PM
find and replace numbers using wildcards Andy Microsoft Word Help 1 May 12th 07 07:42 PM


All times are GMT +1. The time now is 02: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"