Superscript and subscript

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hello,

Welcome to the Message Board!


I didn't see a specific icon for the quick access toolbar in 2007.

You could use the Short Cut Keys CTRL+SHIFT+F to display the text tab.

Another possibility would be to code this and then use buttons:

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Super()<br><br>    <SPAN style="color:#00007F">With</SPAN> ActiveCell.Font<br>        <SPAN style="color:#00007F">If</SPAN> .Superscript = <SPAN style="color:#00007F">False</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>            .Superscript = <SPAN style="color:#00007F">True</SPAN><br>        <SPAN style="color:#00007F">Else</SPAN><br>            .Superscript = <SPAN style="color:#00007F">False</SPAN><br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#007F00">'        If .Subscript = False Then</SPAN><br><SPAN style="color:#007F00">'            .Subscript = True</SPAN><br><SPAN style="color:#007F00">'        Else</SPAN><br><SPAN style="color:#007F00">'            .Subscript = False</SPAN><br><SPAN style="color:#007F00">'        End If</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    <br>End <SPAN style="color:#00007F">Sub</SPAN></FONT>

-Jeff
 
Upvote 0
"then use buttons"?

What do you mean ? I am using 2010 I should have listed that - ooops

Thanks

Michael
 
Upvote 0
Hello,

Shortcut keys --> Alt+F11 to open VBEditor
Keystrokes --> Alt - I - M to insert Standard Module
Paste in the below code

Within the VBEditor press F5 to run
Or
Close the VBEditor, Shortcut Keys ALT+F8 to run
This code may be called by other means including assingning to a button


Code:

Sub Super()

With ActiveCell.Font
If .Superscript = False Then
.Superscript = True
Else
.Superscript = False
End If
' If .Subscript = False Then
' .Subscript = True
' Else
' .Subscript = False
' End If
End With

End Sub



A button may be used to call a macro, in the case of the code above, superscript would be toggled on/off.

-Jeff
 
Upvote 0
That can be reduced to one line:

Code:
Sub SuperscriptIt()
ActiveCell.Font.Superscript = Not (ActiveCell.Font.Superscript)
End Sub
 
Upvote 0
That can be reduced to one line:

Code:
Sub SuperscriptIt()
ActiveCell.Font.Superscript = Not (ActiveCell.Font.Superscript)
End Sub


Thank you for this.

I would have never thought of that. After seeing it though, it makes perfect sense.

-Jeff
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,486
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top