ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Superscript a character in a string (https://www.excelbanter.com/excel-programming/421109-superscript-character-string.html)

RyanH

Superscript a character in a string
 
Is there a way to superscript a character is a string. I want this string to
be entered into a textbox. For example,

This is what I have:
tbxViewingAngle = "140 Degrees Horizontal"

This is what I want:
tbxViewingAngle = "140o Horizontal" (Superscript the "o" in the string)

--
Cheers,
Ryan

Gary''s Student

Superscript a character in a string
 
Give this a try:

Sub dural()
Dim s As String
s = "100" & Chr(176) & " longitude"
MsgBox (s)
End Sub
--
Gary''s Student - gsnu200819


"RyanH" wrote:

Is there a way to superscript a character is a string. I want this string to
be entered into a textbox. For example,

This is what I have:
tbxViewingAngle = "140 Degrees Horizontal"

This is what I want:
tbxViewingAngle = "140o Horizontal" (Superscript the "o" in the string)

--
Cheers,
Ryan


RyanH

Superscript a character in a string
 
Perfect!
--
Cheers,
Ryan


"Gary''s Student" wrote:

Give this a try:

Sub dural()
Dim s As String
s = "100" & Chr(176) & " longitude"
MsgBox (s)
End Sub
--
Gary''s Student - gsnu200819


"RyanH" wrote:

Is there a way to superscript a character is a string. I want this string to
be entered into a textbox. For example,

This is what I have:
tbxViewingAngle = "140 Degrees Horizontal"

This is what I want:
tbxViewingAngle = "140o Horizontal" (Superscript the "o" in the string)

--
Cheers,
Ryan


Bernie Deitrick

Superscript a character in a string
 
Ryan,

You cannot superscript a character in a textbox, but you can use the degree character:

tbxViewingAngle.Text = "140" & Chr(176) & " Horizontal"

HTH,
Bernie
MS Excel MVP


"RyanH" wrote in message
...
Is there a way to superscript a character is a string. I want this string to
be entered into a textbox. For example,

This is what I have:
tbxViewingAngle = "140 Degrees Horizontal"

This is what I want:
tbxViewingAngle = "140o Horizontal" (Superscript the "o" in the string)

--
Cheers,
Ryan





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com