Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Label, couleur de texte

2 réponses
Avatar
JP
Bonsoir,

Je teste des cellules pour savoir si le contenu est inf=E9rieur =E0 0. Dan=
s ce cas je voudrai que ce texte affect=E9 dans un label passe au rouge.

Voici une partie du code:

If Cells(i + 7, 7) < 0 Then
Me.Controls("Label" & i + 15) =3D Format(Cells(i + 7, 6).Value, "##=
00.00 =80")
Me.Controls("Label" & i + 30).ForeColor =3D RGB(255, 0, 0) =3D Form=
at(Cells(i + 7, 7).Value, "##00.00 =80")
End If

Que faut-il modifier?

merci

JP

2 réponses

Avatar
MichD
Bonjour,


If Cells(i + 7, 7) < 0 Then
Me.Controls("Label" & i + 15) = Format(Cells(i + 7, 6).Value,
"##00.00 €")
Me.Controls("Label" & i + 30).ForeColor = RGB(255, 0, 0)
End If


MichD
---------------------------------------------------------------
Avatar
JP
Bonjour Denis,

ok en deux lignes, merci.

JP