change font using macro

  • Thread starter Thread starter L Scholes
  • Start date Start date
L

L Scholes

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?
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top