Excel Subscript & Superscript

Subscript or superscript are mostly used in scientific notation or in Chemical equations.

Like: E = MC2 . 2 as super script to mention a ‘Square’.

Follow these steps to make a part of text as subscript.

  1. Select a text in Excel or part of the Text.
  2. Right click & choose Format Cells (or Ctrl + 1).
  3. Find for Effects section in Fonts tab
  4. Click check box against subscript or superscript.
  5. Click ok

Now the text that you selected will become subscript. There are no easy keyboard shortcuts for this option as of now.

How to make subscript using Excel VBA?

We are going to use the characters property of range object. Using this we can select only a part of the text, then change its font option subscript to true.

Here is the code on how it is done.

'Function to Text the Macro
Sub Test_Subscript()
    Subscript_Text Range("A1"), 2, 2
End Sub

'Actual Excel VBA code to convert Text to Subscript
Sub Subscript_Text(rRng As Range, iStart As Integer, iLen As Integer)
    rRng.Characters(Start:=iStart, Length:=iLen).Font.Subscript = True
End Sub

For example: In cell A1 type E=MC2. Then rename the subscript to superscript in above function. Press F5.

Now, you can see that the number 2 is changed to a superscript.

Just like this, we can also make other font modifications to Excel sheet like: Strikethrough, underline, overline etc.,

Leave a Reply