Superscript entire value in a cell
This tutorial shows how to superscript (above the line) all of the characters in a cell using Excel or VBA
METHOD 1. Superscript entire value in a cell
EXCEL
Right-click on cell > Format Cells > Select Font tab > Check Superscript > Click OK
1. Right-click on the cell that contains the content that you want to format to superscript. 2. Select Format Cells. Note: in this example we have selected cell B2 which contains value of x4. |
3. Select the Font tab. 4. Check the Superscript checkbox. 5. Click OK |
This image shows the result of this process, which has applied a superscript format to an entire value in a cell. |
METHOD 1. Superscript entire value in a cell
VBA
Sub Superscript_entire_value_in_cell()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'superscript a character in a cell
ws.Range("B2").Font.Superscript = True
ws.Range("B2").Font.Superscript = True
End Sub
ADJUSTABLE PARAMETERS
Worksheet Selection: Select the worksheet in which you want to apply a restriction to a cell by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name 'ws' in the VBA code.
Cell Reference: Select the cell that contains the value that you want to superscript by changing the cell reference ("B2") in the VBA code.
Worksheet Selection: Select the worksheet in which you want to apply a restriction to a cell by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name 'ws' in the VBA code.
Cell Reference: Select the cell that contains the value that you want to superscript by changing the cell reference ("B2") in the VBA code.
EXPLANATION
This tutorial shows how to superscript (above the line) all of the characters in a cell using Excel or VBA.
This tutorial provides one Excel method and one VBA method that can be applied to superscript all of the characters in a single cell. Using the Excel method this can be achieved in five steps by using the Format Cells options. The VBA method uses the Font.Superscript function to apply the superscript format against an entire cell.
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Superscript part value in a cell | How to superscript (above the line) only some characters in a cell | |
Clear formatting in cells | How to clear formatting in cells |