Superscripting a portion of a string

B

Bdavis

Hello,

I have a string in a cell as follows =vlookup(A1,Range,2,
False)&" 5"

The five on the end is suppose to be a footnote so I would
like it to superscript. What is the correct syntax?

Thanks,

Ben
 
F

Frank Kabel

Hi Ben
this is not possible with formulas. Formulas only return the value of a
cell and not the format. So no chance with formulas
 
G

Guest

Actually I'm pretty sure it's possible becasue the formula
is concatenated using "&" with a text value. I've done
this before and formated the text as a date... I just
can't rememeber the syntax and I don't know how to create
the superscript.
 
B

Bdavis

Actually I'm pretty sure it's possible becasue the formula
is concatenated using "&" with a text value. I've done
this before and formated the text as a date... I just
can't rememeber the syntax and I don't know how to create
the superscript.
 
F

Frank Kabel

Hi
believe me :)
You cant apply superscript with using a formula. the only thing is you
can concatenate values. BUT they are formated with the cell format of
the cell the formula resides in!
 
D

Don Guillett

You can't do it in a FORMULA but this will give you what you want. Adjust
the start:=2 to suit. Also, you can no longer work with this number in this
form.

Sub superscriptit()
With Range("a3")
..Formula = "=vlookup(a1,b1:c3,2,0) & 5"
..Formula = .Value
..Characters(Start:=2, Length:=2).Font.Superscript = True
End With
 
Top