2 Ways to Batch Change Texts to Superscript or Subscript in Your Word Document

In today’s article, we would like to show you 2 ways to batch change texts to superscript or subscript in your Word document.

Sometimes, we need to change certain texts in Word document to superscripts or subscripts, especially when there are multiple instances of the same text. Under such circumstances, batch replacement is what we need most. For this reason, we offer 2 Quick methods for you to accomplish the task.

Method 1: Use “Find and Replace” Feature

In the coming contents, we will use the sample “DataNumen Word Repair v2.5” as our demonstration. Our aim is to replace the “v2.5” as subscript.The need to replace text with subscript

  1. First and foremost, click “Home” tab.
  2. Next click “Replace” to open the “Find and Replace” dialog box.Click "Home"->Click "Replace"
  3. First enter “ v2.5” in “Find what” text box. Don’t forget enter a space before text.
  4. Then enter “v2.5” in “Replace with” text box. There is no space before the text this time.
  5. Next click “More” button to expand more options.Enter contents->Click "More"
  6. Now click “Format” and choose “Font”.Click "Format"->Choose "Font"
  7. In the “Find Font” dialog box, check the either “Superscript” or “Subscript” box.
  8. Then click “OK”.Check option->Click "OK"
  9. Finally click “Replace All” button.Click "Replace All"

You can check the effect here:Effect of batch replacement

Method 2: Batch Replace by Running Word Macro

  1. To begin with, press “Alt+ F11” to trigger the VBA editor.
  2. Then click “Normal” project and “Insert” tab next.
  3. Choose “Module” on the drop-down menu.Click "Normal"->Click "Insert"->Click "Module"
  4. Next double click on the new module to open the coding area.
  5. Paste the following macro there:
Sub ReplaceTheTextAsSubscript()
  Dim strSelectText As String
  Dim strReplaceText As String
 
  strSelectText = InputBox("Enter the text you want to search", "Select text", "For example: v2.5")
  strReplaceText = InputBox("Enter the text you want to replace with", "Replace text", "For example:v2.5")
 
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find.Replacement.Font
    .Superscript = False
    .Subscript = True
  End With
  With Selection.Find
    .Text = strSelectText
    .Replacement.Text = strReplaceText
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
End Sub
  1. Click “Run”.Paste codes->Click "Run"
  2. First there is the “Select text” box. Input your finding text and click “OK”. In this case, type “ v2.5”.Enter finding text->Click "OK"
  3. Then there is the “Replace text” box. Input the replacing text there and click “OK”. Type “v2.5”.Enter replacing text

If you need to change texts to superscript, you can use this macro:

Sub ReplaceTheTextAsSuperscript()
  Dim strSelectText As String
  Dim strReplaceText As String
 
  strSelectText = InputBox("Enter the text you want to search", "Select text", "For example: v2.5")
  strReplaceText = InputBox("Enter the text you want to replace with", "Replace text", "For example:v2.5")
 
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find.Replacement.Font
    .Superscript = True
    .Subscript = False
  End With
  With Selection.Find
    .Text = strSelectText
    .Replacement.Text = strReplaceText
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Fix Document Errors

Word errors are no stranger to most of us. A collapse Word can result in a corrupt docx file. To address such issue, you need to take hold of a qualified and professional tool to recover the broken document.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupted xlsx and pdf repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *