Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default change font using macro

I need to change the font of the last two characters in a cell, but
only for certain cells (make last two superscript and underlined). Does
anybody have any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default change font using macro

With Range("A2").Characters(Len(Range("A2").Text) - 1, 2).Font
..Superscript = True
..Underline = True
End With

The problem with this is that the underlining is at the bottom of
the cell, not directly under the superscripted characters. I
don't think there is a workaround for this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"L Scholes" wrote in message
oups.com...
I need to change the font of the last two characters in a cell,
but
only for certain cells (make last two superscript and
underlined). Does
anybody have any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default change font using macro

Demo this on a blank worksheet

Sub ShowMe()
With ActiveCell
.Value = "ABCDEFGHIJK"
.Font.Superscript = False
.Font.Underline = False
With .Characters(Len(ActiveCell.Value) - 1, 2)
.Font.Superscript = True
.Font.Underline = True
End With
End With
End Sub


--
Regards,
Tom Ogilvy



"L Scholes" wrote:

I need to change the font of the last two characters in a cell, but
only for certain cells (make last two superscript and underlined). Does
anybody have any suggestions?


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
macro that will change the font of a cell if i change a value jk Excel Discussion (Misc queries) 2 July 29th 08 04:39 PM
Macro to Change Font Color Daniel R. Young Excel Programming 2 October 10th 05 08:58 PM
macro to white out (to change a font in selected cells) Tom Ogilvy Excel Programming 3 February 3rd 05 08:49 PM
How to change font in a macro that inserts a formula in a footer Alan Tolkoff[_2_] Excel Programming 2 January 3rd 05 10:53 PM
Where to stick macro to change default comment font? [email protected] Excel Discussion (Misc queries) 1 January 1st 05 12:57 AM


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