LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Superscript Button

How do I assign a font change to selected charecters within a cell.
Example:
A1: 623154 (as text)
I highlight 231 and run the macro and get this result
6²³¹54

I've been experimenting with macros lately and I wanted to make a
superscript and subscript button. Here is some code I recorded (minus the
junk). It is extremely simple, but I wanted to know if there was a way to
apply the font change to only selected charecters in a cell.



Sub Macro1()
With ActiveCell.Characters(Start:=2, Length:=2).Font
.Superscript = True
End With
End Sub
Sub Macro3()
With Selection.Font
.Subscript = True
End With
End Sub

 
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
Toolbar button for superscript awertj Excel Discussion (Misc queries) 2 January 24th 06 01:06 PM
Superscript Button and Subscript Button Sloth Excel Discussion (Misc queries) 2 August 12th 05 01:58 AM
Button for subscript and superscript in Excel ajkarl Excel Discussion (Misc queries) 1 May 24th 05 11:42 PM
Subscript & Superscript Karen Excel Discussion (Misc queries) 6 February 22nd 05 10:16 PM


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