Microsoft Excel 2007 - Sub/Superscript Buttons

  • Thread starter minger
  • Start date
  • #1
minger
Science Advisor
1,495
1

Main Question or Discussion Point

Does anyone a way (ANY WAY!!) get get these buttons on either the Ribbon or Quicklink toolbars?

p.s. for 2003 and pre users, yes I am aware that typically one would simply "Customize Toolbars", find the icons and drag them where you want them. However, though an option in Word, for some reason they are left out in Excel and the current only way to get sub/superscripts is to highlight, Format Font, then click the appropriate box.

I had found a couple of VBA scripts that 'should' have added the icon (apparently the icon exists, there's just no "link" to it), however they have all failed. I DO NOT want to download the third-party sub/superscript addin; it's totally unecessary (or at leaset should be).

Anywho, if anyone who's upgraded has solved this problem I would GREATLY appreciate it. Thanks a lot,
 

Answers and Replies

  • #2
cristo
Staff Emeritus
Science Advisor
8,107
72
How about this?

http://office.microsoft.com/en-us/excel/HA100860481033.aspx#2 [Broken]

Course, I don't have office, so this may be what you refer to above...
 
Last edited by a moderator:
  • #3
minger
Science Advisor
1,495
1
It is. There is no icon in the "customize quickbar" to allow you to place the button there.
 
  • #4
seycyrus
It is. There is no icon in the "customize quickbar" to allow you to place the button there.
Oh cmon! You don't need to do that. It would make it too easy! Just enjoy the soothing pastel colors while you go back and forth and back and ...
 
  • #5
minger
Science Advisor
1,495
1
I'm still waiting for a word processor to include some basic latex functionality. It would be really nice to be able to just
blah blah blah, and then you can see that as $\sin\theta$ goes to...
but of course there would need to be some sort of other Math environment callout.

Either way, Microsoft, fix my damn EXCEL!!
 
  • #6
Here are a few short macros that create an in-cell editor specifically for doing super and subscripting. Just copy the code below into a text file ending in .BAS, open the VB editor (Alt-F11), right-click "Modules" in the project tree, and select import file. Add quick access to SuperSubTop() using a button or keystroke and enjoy!


'SuperSub -- an in-cell editor to do superscript and subscript easily
'To install: put this code in a module in your personal workbook (Alt-F11 to open code window)
'Run SuperSubTop when cell to be edited is selected (add to toolbar, keystroke activate, etc.)
'Right/left arrow keys move cursor (underline character)
'Up/Down arrow keys make character at cursor superscript/subscript
'Enter exits routine and returns keys to normal
'
'Version 1.0
'Author: Patrick Wiegand
'Company: Rock Lake Software (RockLakeSoftware.com)
'Release date: 9/23/09
'License: Free for personal use, re-distribution not allowed unless free
'Disclaimer: The author is not responsible for use or misuse of this software.
' USE AT YOUR OWN RISK
'*** Anonomyously do a good deed today and be civil to those of differing viewpoints... --Pat ***


Private charpos As Integer, curcol As Integer, currow As Integer
Sub SuperSubTop()
'temporarily re-define some keys
Application.OnKey "{Down}", "DoDown"
Application.OnKey "{Up}", "DoUp"
Application.OnKey "{Left}", "DoLeft"
Application.OnKey "{Right}", "DoRight"
Application.OnKey "{Enter}", "DoEnter"
Application.OnKey "~", "DoEnter"
Beep
'next IF allows re-running this routine after selecting a different cell without hitting enter
If ActiveCell.Row <> currow Or ActiveCell.Column <> curcol Then
charpos = 1
ActiveCell.Characters(charpos, 1).Font.Underline = True
currow = ActiveCell.Row
curcol = ActiveCell.Column
End If
'Warning -- shameless self-promotion on next line!
Application.StatusBar = "Rock Lake Software's SuperSub in-cell editing activated. Enter to exit, arrow keys to edit/move."

End Sub

Private Sub DoEnter()
'the exit routine. Returns keys to their original use
Application.OnKey "{Down}"
Application.OnKey "{Up}"
Application.OnKey "{Left}"
Application.OnKey "{Right}"
Application.OnKey "{Enter}"
Application.OnKey "~"
Cells(currow, curcol).Characters(charpos, 1).Font.Underline = False
'Oh No! More shameless self-promotion
Application.StatusBar = "Rock Lake Software's SuperSub routine ended. Keys returned to normal usage."
Beep
End Sub

Private Sub DoRight()
'move cursor to the right. Next if will run exit routine if user forgot and selected another cell with mouse.
If ActiveCell.Row <> currow Or ActiveCell.Column <> curcol Then
DoEnter
Exit Sub
End If

If Len(ActiveCell.Text) > charpos Then
charpos = charpos + 1
ActiveCell.Characters(charpos - 1, 1).Font.Underline = False
ActiveCell.Characters(charpos, 1).Font.Underline = True
End If

End Sub
Private Sub DoLeft()
'move cursor to the left
If ActiveCell.Row <> currow Or ActiveCell.Column <> curcol Then
DoEnter
Exit Sub
End If
If charpos > 1 Then
charpos = charpos - 1
ActiveCell.Characters(charpos + 1, 1).Font.Underline = False
ActiveCell.Characters(charpos, 1).Font.Underline = True
End If

End Sub

Private Sub DoUp()
'make current character above cursor superscripted if normal or normal if subscripted
If ActiveCell.Row <> currow Or ActiveCell.Column <> curcol Then
DoEnter
Exit Sub
End If
'Wierdness next few lines. Not sure why you can't just set subscript to false...
If ActiveCell.Characters(charpos, 1).Font.Subscript = True Then
ActiveCell.Characters(charpos, 1).Font.Superscript = True
ActiveCell.Characters(charpos, 1).Font.Superscript = False
Else
ActiveCell.Characters(charpos, 1).Font.Superscript = True
End If
End Sub
Private Sub DoDown()
'make current character above cursor subscripted if normal or normal if superscripted
If ActiveCell.Row <> currow Or ActiveCell.Column <> curcol Then
DoEnter
Exit Sub
End If
If ActiveCell.Characters(charpos, 1).Font.Superscript = True Then
ActiveCell.Characters(charpos, 1).Font.Superscript = False
Else
ActiveCell.Characters(charpos, 1).Font.Subscript = True
End If
End Sub
 
  • #7
7
0
Thanks for posting this, it has been a time saver. The 'beep' was a bit annoying, though:smile:
 

Related Threads for: Microsoft Excel 2007 - Sub/Superscript Buttons

Replies
8
Views
11K
  • Last Post
Replies
15
Views
137K
  • Last Post
Replies
9
Views
3K
Replies
6
Views
2K
  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
5
Views
403
Replies
4
Views
4K
  • Last Post
Replies
3
Views
3K
Top