Code VBA Cellule colorisée avex texte

Bonjour

Il faudrait dans le code ci dessous y incorporer :

- du texte "cds", avec comme couleur de police blanc.

Le code :

Sub CdS()

With Selection.Interior

.Pattern = xlGrid

.PatternColorIndex = xlAutomatic

.ColorIndex = xlAutomatic

.TintAndShade = 0

End With

End Sub

Merci de votre aide.

Fred.

Bonjour,

Une piste. Je ne trouve pas le résultat top mais bon, c'est toi qui vois :

Sub CdS()

    With Selection

        .Value = "cds"
        .Font.ColorIndex = 2

        With .Interior

            .Pattern = xlGrid
            .ColorIndex = xlAutomatic

        End With

    End With

End Sub

Merci

Je vais tester,

Cdt

Rechercher des sujets similaires à "code vba colorisee avex texte"