View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BoJosley BoJosley is offline
external usenet poster
 
Posts: 1
Default Superscrpts in Excel 2007 Text boxes

I have a problem superscripting characters in Excel 2007 Text Boxes. What's
strange is that I have no problem subscripting characters in Excel 2007 nor
do I have a problem with superscripts in Excel 2003.

Here are two simple macros one for superscripts and subscripts.

Sub Superscript()
' WORKS IN EXCEL 2003 NOT IN EXCEL 2007
Application.CommandBars("Drawing").Visible = True
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 117#, 60#, _
117.75, 63.75).Select
Selection.Characters.Text = "hello"
With Selection.Characters(Start:=1, Length:=4).Font
.Name = "Comic Sans MS"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Characters(Start:=5, Length:=1).Font
.Name = "Comic Sans MS"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = True
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("E12").Select
End Sub

Sub Subscript()
' WORKS IN Both EXCEL 2003 AND EXCEL 2007
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 115.5, 162#, _
127.5, 89.25).Select
Selection.Characters.Text = "hello"
With Selection.Characters(Start:=1, Length:=1).Font
.Name = "Comic Sans MS"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Characters(Start:=2, Length:=1).Font
.Name = "Comic Sans MS"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = True
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Characters(Start:=3, Length:=3).Font
.Name = "Comic Sans MS"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("F21").Select
End Sub