Superscript Subscript - part of a cell - using VBA

Mudface,

That's what I thought, but I thought I'd give a chance to the GURUs here to prove me wrong!

I now know that you can just use ctrl-1 and choose the box, but it would be satisfying to learn how to get around it. (if at all possible).

Come on!, people! PROVE ME WRONG!! :)
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You can't even activate a macro and keep cell active in the "edit" state. If you see what I mean. If you don't then :p
 
Upvote 0
Hi Guys

glad you responded to my post!!!!!

Like i say in all my posts these are thinks i do or have done, i guess im wrong then!

I guess you do not want the script!

If you dont respond i will not know if youhave read my post or if you wish to respond.

Im not saying respond to me only of cause but ive offered help and you do not have an answer do you!

maybe what i post is of some value.. not having a go,.. but im sure your see my point.... maybe ill bother to find this code or maybe not

NUT you know only to wel my name and love or hate me ill help if i can.......
 
Upvote 0
How about using an inputbox to choose part of the cell?

Or using an inputbox to ask you to choose the cell,
THEN counts number of characters,
THEN asks you where to start and stop the supercript or subscript,
THEN asked if you want to superscript or subscript
THEN asks if you want to superscript/subscript (depending on what was choosen) "selectect text"(have excel store the text part selected for formatting),
THEN carries it out?

Is this possible?

Here's some code to get people started..

Range("A1").Select
ActiveCell.FormulaR1C1 = "m3"
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

'Use inputbox?
With ActiveCell.Characters(Start:=2, Length:=1).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = True
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("D7").Select
End Sub


I know it would probably be better to use CTRL-1 and just click the apporpriate box, but I want to know if this would work. And hopefully learn some VBA along the way.

Probably won't since I don't know much about writing VBA, but I had to ask! :)
This message was edited by cosmos75 on 2002-04-19 12:26
This message was edited by Cosmos75 on 2002-04-19 12:59
 
Upvote 0
Jack in the UK,

Sure I would love your help. I did see your post in the other topic so I thought that your answer would be like the other answers here, that it would apply to the whole cell and not part of it.
 
Upvote 0
Sorry been busy i do track my work best i can ill post on here ASAP and send it over in private or email as well, ASAP

have a play it does work

say Jack in the UK postes on MrExcel

then you can highlight th UK in red or suprescript it, i used it for dates say 20th so the th supered buthe date was not at the start or the text string if you get me IE

Jack in the UK 20th April 2002 postes on MrExcel

you want the *th* super script?
 
Upvote 0

Forum statistics

Threads
1,213,522
Messages
6,114,112
Members
448,549
Latest member
brianhfield

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
Back
Top