Convert first character in string to superscript syntax

Margarita

Registered User.
Local time
Today, 15:55
Joined
Aug 12, 2011
Messages
185
Hello,
I have been playing with different version of the following line to convert the first character of a string to a superscript but nothing in working. The line, as is, converts the whole cell contents to superscript. Would anyone be able to point out where I am making a syntax mistake?

PHP:
wb.sheets("TestSheet").Range("A" & lastrowoftestsheet + 1 + i).Characters(Start:=1, Length:=0).Font.Superscript = True

Thank you!
 
You need to set the remaining characters to not superscript:

Code:
With wb.sheets("TestSheet").Range("A" & lastrowoftestsheet + 1 + i)
    .Characters(Start:=1, Length:=1).Font.Superscript = True
    .Characters(Start:=2, Length:=(Len(.Value) - 1)).Font.Superscript = False
End With
 
You need to set the remaining characters to not superscript:

Code:
With wb.sheets("TestSheet").Range("A" & lastrowoftestsheet + 1 + i)
    .Characters(Start:=1, Length:=1).Font.Superscript = True
    .Characters(Start:=2, Length:=(Len(.Value) - 1)).Font.Superscript = False
End With


Thank you! Works like a charm!!!
 

Users who are viewing this thread

Back
Top Bottom