ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to create automatic subscript/superscript as you type? (https://www.excelbanter.com/excel-discussion-misc-queries/664-how-create-automatic-subscript-superscript-you-type.html)

kt

How to create automatic subscript/superscript as you type?
 
the same way as in Word, for example, when typing CO2, it will automatically
change to CO(subscript)2

I know how to do that with symbol in AutoCorrect fuction, but no idea with
subscript...

anybody?

kt

Also, I'm aware of the J-Walk add-in.. but you'd have to select and change
one cell at a time which is not very convenient for me because I have
equations x1+ x2 + x3 ... etc. throughout the worksheet...

Mark

The only way to do it is to select the 2 in CO2 then
Format Cells then checkmark Subscripts.

When you select the cell, do not use the address bar. You
have to double-click the cell and highlight the number
only then format it as subscript. You can change its font
size and color too.

Do not tell anyone. This is a secret worth thousands of
dollars.



- mark

How about select the number then change the fon
-----Original Message-----
the same way as in Word, for example, when typing CO2, it

will automatically
change to CO(subscript)2

I know how to do that with symbol in AutoCorrect fuction,

but no idea with
subscript...

anybody?
.


Dave Peterson

There's no macro you can use.

When you're typing in a cell (or the formula bar), no meaningful macro can be
running.

If your strings were always the same format, you could have a macro run that
parses your string, picks out the characters that should be
superscripted/subscripted and puts it back.

But I think you'd need to say what the rules are for parsing the string.



kt wrote:

Also, I'm aware of the J-Walk add-in.. but you'd have to select and change
one cell at a time which is not very convenient for me because I have
equations x1+ x2 + x3 ... etc. throughout the worksheet...


--

Dave Peterson


All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com