Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel superscript
Message
 
 
À
07/05/2007 13:23:22
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01223124
Message ID:
01223127
Vues:
17
>Is it possible to insert text into a cell in oExcel which has a superscript associated with it? Something like:
>
>
>oExcel.range('A1').value = "Textwithsuperscript" + somecontrolcode + '1'
>
>
>So that to '1' shows up as a superscripted character. I think this should be possible since you can have multiple fonts in a cell, but how to accomplish it is a mystery (to me).
>
>Thanks

With a macro:
With ActiveCell.Characters(Start:=1, Length:=5).Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With ActiveCell.Characters(Start:=6, Length:=5).Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 10
        .Strikethrough = False
        .Superscript = True
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    Range("D17:D18").Select
    Range("D18").Activate
    Application.CommandBars("Stop Recording").Visible = False
    Range("A2").Select
End Sub
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform