![]() |
#1
|
|||
|
|||
![]()
hello sirs
wish you help me by your knowledge i've a long word documents need to change some numbers on it as you know in ms-word when we wrote numbers in Arabic from right to left the program reverse it to look as o'clock left to right example : if we want this one and half wrote it 30:1 to appear 1: 30 so, people here wrote wrong to appear right, now, i need to reverse those number cause screen-reader read them wrong it read for me what we wrote not what word show (as a blind man) is any way let me rewrite all numbers again from 30:1 to 1:30 ? am so sorry for this long message many thanks |
#2
|
|||
|
|||
![]() Code:
Sub Macro1() Dim oRng As Word.Range Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Set oRng = ActiveDocument.Range With oRng.Find 'Selection.Find .Text = "([0-9]{1,})(:)([0-9]{1,})" .Replacement.Text = "\3\2\1" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End Sub |
#3
|
|||
|
|||
![]()
dear gmaxey
thanks very much for your help. please could you explain this code i tried it via find and replace command the question if the number 10:50 need to be 50:10 this work or need to change thing? another point, is any solution let word show numbers from right to left as we wrote? to not need to write wrong to show right many thanks again |
#4
|
||||
|
||||
![]() Quote:
FWIW, the equivalent wildcard Find/Replace without using a macro is: Code:
Find = ([0-9]{1,})(:)([0-9]{1,}) Replace = \3\2\1 Code:
Find = (<[0-9]@)(:)([0-9]@>) Replace = \3\2\1
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
pls. what's the different between 2 exprissions?
|
#6
|
||||
|
||||
![]()
What is different is that one could be affected by your regional settings; the other isn't. For some regions (those that use ',' as a decimal separator), the {1,} would have to be changed to {1;}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
is there anyway let word show numbers as we wrote and not need to wrote wrong to appear right on screen?
for example: if we want to write one and half, now we wrote 30:1 to be shown 1 : 30 and this make big problem with my screen-reader while read documents. thanks |
#8
|
||||
|
||||
![]()
If you want to add spaces either side of the colon, change \3\2\1 to \3 \2 \1.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to change the formatting of numbers without changing the numbers? | sullengirl | Word | 2 | 01-27-2014 03:06 PM |
How do I refer to page numbers, when the numbers change as I prepare the document? | StevenD | Word | 5 | 11-29-2012 12:52 AM |
![]() |
rbaldwin | Word VBA | 3 | 03-14-2012 02:31 PM |
![]() |
gracie5290 | Word | 1 | 02-02-2012 11:41 PM |
Extract Numbers from Zip Code | Karen615 | Excel | 3 | 09-21-2011 06:54 AM |