A
avkokin
Hello.
There is document which has some such words as m2, m3 with different
case. I need to change these numbers to superscript. I use my macro
but I get the cycle. Why and how to repair it? Thank you.
Sub M2()
Dim rng As Range
Set rng = ActiveDocument.Range
With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.MatchWildcards = True
.Wrap = wdFindContinue
.Text = "[M-Í][1-9]{1}"
.Execute
While .Found
Selection.MoveRight wdCharacter, 1, wdExtend
Selection.Font.Superscript = True
.Execute
Wend
End With
End Sub
There is document which has some such words as m2, m3 with different
case. I need to change these numbers to superscript. I use my macro
but I get the cycle. Why and how to repair it? Thank you.
Sub M2()
Dim rng As Range
Set rng = ActiveDocument.Range
With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.MatchWildcards = True
.Wrap = wdFindContinue
.Text = "[M-Í][1-9]{1}"
.Execute
While .Found
Selection.MoveRight wdCharacter, 1, wdExtend
Selection.Font.Superscript = True
.Execute
Wend
End With
End Sub