Pb changement couleur

cs_nawre Messages postés 4 Date d'inscription lundi 24 mai 2004 Statut Membre Dernière intervention 9 juin 2004 - 28 mai 2004 à 10:21
econs Messages postés 4030 Date d'inscription mardi 13 mai 2003 Statut Membre Dernière intervention 23 décembre 2008 - 28 mai 2004 à 11:25
bonjour,

g 1 pb pour changer la couleur d'une selection sachant que cette derniere n'est jamais la meme en fonction des cases

g m'explique :
g 1 variabl "var_machin" que g reporte dans une case avec une autre variabl "var_bidul"

en VB :
var_machin=cells(1,1)
var_bidul=cells(1,2)
cells(1,3)=var_bidul & var_machin

et g vouvrais ecrire "var_machin" en rouge et "var_bidul" en noir est ce que c'est possible ?

merci d'avance

erwan

1 réponse

econs Messages postés 4030 Date d'inscription mardi 13 mai 2003 Statut Membre Dernière intervention 23 décembre 2008 24
28 mai 2004 à 11:25
Avec çà, j'écris une connerie ("dfghdgfhfgh") dans la case J2 et je colorie en rouge les 4è, 5è et 6è caractères :

    Range("J2").Select
    ActiveCell.FormulaR1C1 = "dfghdgfhfgh"
    With ActiveCell.Characters(Start:=1, Length:=3).Font
        .Name = "Arial"
        .FontStyle = "Normal"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    With ActiveCell.Characters(Start:=4, Length:=3).Font
        .Name = "Arial"
        .FontStyle = "Normal"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = 3
    End With
    With ActiveCell.Characters(Start:=7, Length:=5).Font
        .Name = "Arial"
        .FontStyle = "Normal"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With



Manu
0
Rejoignez-nous