LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Special string formatting

I don't think that you can format a cell to show
super/sub scripted characters. However, you can edit the
text to do thiis, but you'll lose the formula.
Here's a test example which should show how



Sub test()

Range("B2").Value = "2,45M3"

showcubed Range("B2")

End Sub
Function showcubed(ByRef target As Range)
'
'sets the last character to superscript
'
Dim length As Long
length = Len(target.Value)

With target.Characters(Start:=length, length:=1).Font
.Superscript = True
End With

End Function


Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Am using a excel report generator which works with excel

template file.
Have a cell in the template file which is referred to

as Grid_Value.
This cell is populated with a string representing cubic

meters of
water i.e
203.34M3
How can the field be formatted in vba to show 203.34 M

(superscript)3


---
Message posted from http://www.ExcelForum.com/

.

 
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
special formatting? jim sturtz Excel Worksheet Functions 3 September 18th 06 04:31 PM
remove special character at end of string captain bob Excel Discussion (Misc queries) 0 August 3rd 06 02:59 PM
How do you count (not sum) cells containing special formatting? tbank Excel Worksheet Functions 1 October 12th 05 10:13 PM
Special cell formatting Sunshine Excel Discussion (Misc queries) 2 April 7th 05 10:05 PM
Escape for special characters in string Jag Man Excel Programming 2 January 2nd 04 03:56 AM


All times are GMT +1. The time now is 03:21 PM.

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

About Us

"It's about Microsoft Excel"