![]() |
|
#1
|
||||
|
||||
![]()
Assuming the numbers are superscripted text (not footnote/endnote references and the like), you could use a macro like:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "[0-9]@>" .Font.Superscript = True .Replacement.Text = "" .Format = True .Forward = True .Wrap = wdFindStop .MatchWildcards = True .Execute End With Do While .Find.Found .Text = CLng(.Text + 1) .Collapse wdCollapseEnd .Find.Execute Loop End With Application.ScreenUpdating = True End Sub For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
quick question,
how could I set the increment the superscript based upon the value of the preceeding superscript. for example x^1 x^32 x^66 would become x^1 x^2 x^3 |
#3
|
|||
|
|||
![]()
got it!
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "[0-9]@>" .Font.Superscript = True .Replacement.Text = "" .Format = True .Forward = True .Wrap = wdFindStop .MatchWildcards = True .Execute End With Do While .Find.Found If .Text = "0" Then .Text = CLng(.Text + 1) i = 1 Else .Text = CLng(i + 1) i = i + 1 .Collapse wdCollapseEnd .Find.Execute End If Loop End With Application.ScreenUpdating = True End Sub Last edited by macropod; 12-08-2014 at 06:33 PM. Reason: Added code tags & formatting |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
areriff | Word VBA | 5 | 08-21-2022 04:28 PM |
Insert superscript into a textbox | Deltaj | Word VBA | 3 | 11-30-2014 04:23 PM |
![]() |
docbike | Word | 4 | 04-07-2014 05:23 PM |
Combining Files--Superscript problem | lindajacques | PowerPoint | 0 | 01-06-2011 01:20 PM |
![]() |
louq | Word | 1 | 10-22-2009 09:29 AM |