Any shortcut for subscript and postscript in Excel?

smallxyz

Active Member
Joined
Jul 27, 2015
Messages
376
Hi,

To subscript /postscript a certain letter within a cell, I wonder if there exists any more convenient shortcut to do so.
The best to my knowledge is to utilize Ctrl + 1, after selecting the letters within the cell.

Could there be any VBA solution or add-in for this?

I am currently using Excel 2007.

Thanks!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

James006

Well-known Member
Joined
Apr 4, 2009
Messages
4,750
Office Version
  1. 2016
Platform
  1. Windows
Hi,

You could test and adapt the following
Code:
Sub Test()
ActiveCell.Characters(Start:=Len(ActiveCell), Length:=1).Font.Superscript = True
End Sub

HTH
 
Upvote 0

smallxyz

Active Member
Joined
Jul 27, 2015
Messages
376
Hi James, your code works well to superscript the last characters.
Thanks!

Is it also possible to superscript any other characters from different positions?
 
Upvote 0

James006

Well-known Member
Joined
Apr 4, 2009
Messages
4,750
Office Version
  1. 2016
Platform
  1. Windows
Hi,

As I said, you can adapt the code to your needs ... :wink:

The portion .Characters(Start:= ...., Length:= ...) allows to precisely isolate any character in any position ...

HTH
 
Upvote 0

thisoldman

Well-known Member
Joined
Jan 5, 2014
Messages
1,075
ADVERTISEMENT
Perhaps you are looking to display chemical formulas? I've been generally pleased with the results of the Excel and Word add-ins from http://christopherking.name/ChemFormat/index.html

I've tried the add-ins using Office 2003 and 2013. There are occasional issues but they work exactly as I want 99 percent of the time.
 
Upvote 0

smallxyz

Active Member
Joined
Jul 27, 2015
Messages
376
Yes. In this way it may require frequent adjustments to the code.
I wonder if VBA could let Excel behave like Word's superscript-while-user-is-typing.
In this way, the superscript process will be more flexible.
 
Upvote 0

thisoldman

Well-known Member
Joined
Jan 5, 2014
Messages
1,075
I don't know if that is possible in Excel. I haven't been able to get a macro to run while Excel is in "Enter" or "Edit" modes. All the macros I've found do the font change after the data has been fully entered.
 
Upvote 0

thisoldman

Well-known Member
Joined
Jan 5, 2014
Messages
1,075
A workaround using keyboard shortcuts

While you're entering your text, press Ctrl+1. This brings up the format dialog for the font.
Next, to start typing in superscript, press Alt+e then the Enter key. To leave superscript mode, press Ctrl+1 and again press Alt+e and Enter.

To switch to subscripts, press Alt+b.

After a few thousand times, you might find the key-sequence finger-dance stops being annoying and awkward.
 
Upvote 0

Forum statistics

Threads
1,195,746
Messages
6,011,416
Members
441,613
Latest member
worksux

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
Top