Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Microsoft Excel 2007 - Sub/Superscript Buttons

  1. Apr 21, 2009 #1

    minger

    User Avatar
    Science Advisor

    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,
     
  2. jcsd
  3. Apr 21, 2009 #2

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    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: May 4, 2017
  4. Apr 22, 2009 #3

    minger

    User Avatar
    Science Advisor

    It is. There is no icon in the "customize quickbar" to allow you to place the button there.
     
  5. Apr 22, 2009 #4
    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 ...
     
  6. Apr 23, 2009 #5

    minger

    User Avatar
    Science Advisor

    I'm still waiting for a word processor to include some basic latex functionality. It would be really nice to be able to just
    but of course there would need to be some sort of other Math environment callout.

    Either way, Microsoft, fix my damn EXCEL!!
     
  7. Sep 23, 2009 #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
     
  8. Mar 25, 2010 #7
    Thanks for posting this, it has been a time saver. The 'beep' was a bit annoying, though:smile:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Microsoft Excel 2007 - Sub/Superscript Buttons
Loading...