Subscripts and superscripts

S

Scott

I believe that a limitation to macro recording within Excel disables a user
from ending a macro recording when a menu is open.

I know there are no keyboard shortcuts for subscripts and superscripts
within Excel, as there are for Word.

As an attempt to work around the limitations, I began a macro and oped the
Format Cells dialogue box, and displayed the tab that shows the supscript and
superscript commands. I attempted to stop the macro but could not because the
menu was open.

Does anyone have a way to get around this, or have a macro/program that will
allow a user to create a keyboard shortcut for subscripts and superscripts?

I rely on these two commands heavily for work and it is a constant nag to
have to open and close the menu.

Thanks in advance for anyone's help.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...4f457c0&dg=microsoft.public.excel.programming
 
J

Jim Thomlinson

Here is my take on what you are wanting to do. In a standard code module
(same place your recorded macro landed paste the following code

Public Sub ConvertToSuperScript()
With Selection.Font
.Superscript = Not .Superscript
End With
End Sub

Public Sub ConvertToSubScript()
With Selection.Font
.Subscript = Not .Subscript
End With
End Sub

go back to XL and select Macro -> Macros...
Select one of the tow macros and then hit the options button. Define the
keyboard shortcut key. Do the same for the other macro in the list.

The macros will toggle back and forth between Super / Sub and regular script.
 
J

Jim Thomlinson

After re-reading your post it looks like you are wanting to chnge some but
not all characters to be super or sub script. That being the case go with
Dave's solution. Macros can not run while you are in edit mode within a cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top