Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA to superscript a part of a cell

You may want to try John Walkenbach's addin:
http://j-walk.com/ss/excel/files/supersub.htm

Mikhail Bogorad wrote:

hi
i have a report that populates some text descriptions in cells range
B2:B15. So sometimes text has a date, for example "... October
1st...". What i want is to superscript letters "st" every time it
finds "1st".

Has anyone ever encountered this problem before?

Thanks


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA to superscript a part of a cell

On Apr 16, 8:04*am, Dave Peterson wrote:
You *may want to try John Walkenbach's addin:http://j-walk.com/ss/excel/files/supersub.htm

Mikhail Bogorad wrote:

hi
i have a report that populates some text descriptions in cells range
B2:B15. So sometimes text has a date, for example "... October
1st...". What i want is to superscript letters "st" every time it
finds "1st".


Has anyone ever encountered this problem before?


Thanks


--

Dave Peterson


Thanks guys, i'll test your suggestions and let you know. In my report
it can only be "1st" no "2nd" or "3rd" but thanks anyways.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default VBA to superscript a part of a cell

Thanks guys, i'll test your suggestions and let you know. In my report
it can only be "1st" no "2nd" or "3rd" but thanks anyways.


In that case, the macro code can be reduced to this...

Sub SuperScriptOrdinals()
Dim X As Long, Position As Long, C As Range
For Each C In Range("B2:B15")
Position = InStr(C.Value, "1st")
If Position Then C.Characters(Position + 1, 2).Font.Superscript = True
Next
End Sub

--
Rick (MVP - Excel)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to superscript a part of a cell Ron Rosenfeld Excel Programming 3 April 16th 10 12:01 PM
VBA to superscript a part of a cell Peter T Excel Programming 4 April 16th 10 11:30 AM
VBA to superscript a part of a cell Ron Rosenfeld Excel Programming 0 April 16th 10 02:00 AM
VBA to superscript a part of a cell Gord Dibben Excel Programming 0 April 15th 10 11:12 PM
how do i superscript part of a cell in MS Excel? allan Excel Discussion (Misc queries) 0 July 13th 05 08:12 PM


All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"