Superscript Subscript - part of a cell - using VBA

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

I don't have 200 to test, but I am pretty sure it will work. Probably XP, too, although I don't know the exact answer.

Bye,
Jay
 
Upvote 0
Tried it in EXCEL 2000 it works. But I installed it twice, once for me and another time to show how to do it to a collegue and now I have the add-in showing up twice on my Tools toolbar, how do I get rid of one?
 
Upvote 0
Hey. Ironically I came to this thread initially to get an answer for my own problems which were quite similar. Anyway, try this code. What it does is basically catches all the numericals from the string and subscripts them.

Hopefully it would be useful for you if you just want to subscript cubes and squares.


Sub Numeric_subscriptor()
Dim rng As Range
Dim i, i_n As Integer
For Each rng In Selection
i_n = Len(rng)
i = 1
Do While i <= i_n
i = i + 1
If IsNumeric(Mid(rng, i, 1)) = True Then
With rng.Characters(i, 1).Font
.Subscript = True
End With
End If
Loop
Next rng
End Sub
 
Upvote 0
Is there a way to superscript or subscript only part of a cell's text? The forum below provides VBA to superscript an entire cell.

How about just part of a cell?

e.g. A1 = m3, I want to superscript the 3.

http://www.mrexcel.com/board/viewtopic.php?topic=856&forum=2
This message was edited by Cosmos75 on 2002-04-19 11:39
hi brothers,,,my problem is also of the same nature but with a little difference,,,,i assign (1010)2 to an inkedit control and i want to convert 2 to subscript. I have tried ,,UserForm1.InkEdit1.Text = "(1010)" & ChrW(8322),,,,,,,,but it is also not working..instead this piece of code appends a pipe symbol(|), at the end of (1010),,,,.shall be grateful for any guidance..........thanks a lot
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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