F
FotoArt
hello everyone
I'm using the following code to reverse numerical figures in a word document.
The problem is when it encounters a decimal figure such as 71.6 it would not
reverse. I want all numerical characters to be reversed. So 71.6 should come
out as 6.17.
code:
Sub Aburaa()
Dim myText As Range
Dim myFinalWord As String
Dim aWord As Variant
Set myText = ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End)
For Each aWord In myText.Words
If IsNumeric(aWord) Then
myFinalWord = StrReverse(aWord)
With Selection.Find
.Text = aWord
.Replacement.Text = myFinalWord
.Format = False
.MatchCase = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'MsgBox (myFinalWord)
End If
Next aWord
End Sub
Any help would be appreciated.
thanx
ahmed
I'm using the following code to reverse numerical figures in a word document.
The problem is when it encounters a decimal figure such as 71.6 it would not
reverse. I want all numerical characters to be reversed. So 71.6 should come
out as 6.17.
code:
Sub Aburaa()
Dim myText As Range
Dim myFinalWord As String
Dim aWord As Variant
Set myText = ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End)
For Each aWord In myText.Words
If IsNumeric(aWord) Then
myFinalWord = StrReverse(aWord)
With Selection.Find
.Text = aWord
.Replacement.Text = myFinalWord
.Format = False
.MatchCase = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'MsgBox (myFinalWord)
End If
Next aWord
End Sub
Any help would be appreciated.
thanx
ahmed