Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



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
Default font for pasted text in text boxes - Excel 2007 MS OFFICE USER EIT Excel Discussion (Misc queries) 0 March 25th 10 09:01 PM
Tabbing between text boxes in Excel 2007 eswack Excel Discussion (Misc queries) 1 March 11th 10 11:03 PM
Spelling and text boxes in Excel 2007 Tony Excel Worksheet Functions 0 April 18th 08 09:15 PM
Excel 2007 Text Boxes Gibby Excel Discussion (Misc queries) 3 December 21st 07 02:36 PM
Excel 2007 Text boxes & Graphics Matt Warden Excel Discussion (Misc queries) 2 May 3rd 07 05:44 PM


All times are GMT +1. The time now is 06:42 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"