upper case for the last two number in a cell

elainiee

New Member
Joined
Mar 26, 2013
Messages
11
Hello,

I have an excel table of one column (No. 1-100).
The 100 cells are composed of values such as 1.98025, 2.34525, and 6.42325.
I want to make all the "25" upper case and keep the other number the same.

Please kindly advise how to code the need without changing the setting 100 times.
Thank you.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Not sure I understand what you mean by an Upper Case 'Number'
As far as I know, there's no such thing as Upper and/or Lower Case Numbers.
There are Upper Case and Lower Case 'Letters' Aa Bb etc.. But not numbers.
 
Upvote 0
Hello,

I need to modification my question.
I want to make all the "25" in the upper place of a cell, such as 1"st".
Thank you.

Hello,

I have an excel table of one column (No. 1-100).
The 100 cells are composed of values such as 1.98025, 2.34525, and 6.42325.
I want to make all the "25" upper case and keep the other number the same.

Please kindly advise how to code the need without changing the setting 100 times.
Thank you.
 
Upvote 0
Still not clear what you mean by upper place of a cell

Can you give some before AND after examples?
 
Upvote 0
Still not clear what you mean by upper place of a cell

Can you give some before AND after examples?

I believe he is looking to format only a portion of the cell with "superscript" formatting.

Unfortunately this is not a possibility with excel UNLESS you separate the "25" with a space - then it would be.
Is this something you would be willing to do just for the format change?
 
Upvote 0
Yes, I need a "superscript" formatting.
Please kindly advise how to make it for 25 100 times with a space.
many thanks.

Elaine
 
Upvote 0
Assuming the data is in Column B, the sheet name is Sheet1, and there are 7 characters in each piece of data... this will work

Code:
Sub ReplaceSup()
    Worksheets("Sheet1").Columns("B").Replace _
    What:="25", Replacement:=" 25", _
    SearchOrder:=xlByColumns, MatchCase:=True
    
    With Worksheets("Sheet1").Columns("B").Characters(Start:=7, Length:=2).Font
        .Superscript = True
    End With
End Sub

It's probably very messy, so you may want to wait for someone else with Macro experience to come around and solve it - but it's a good start! haha
 
Upvote 0
Thanks a lot.
What if the number of character (actually they are digits) are 6 or 7, and I wanna the last two digits to be superscript?

Elaine
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,826
Members
449,190
Latest member
rscraig11

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