XL 2013 Formaté Textbox

maval

XLDnaute Barbatruc
Bonjour

Je cherche a modifier mon TextBox et j'ai mis comme code ceci mais a toute évidence il doit y avoir une erreur au niveau de "Selection.Font"

Code:
Private Sub TextBox5_Change()
 If TextBox5 = "DCD" Then
 TextBox5.ForeColor = RGB(255, 0, 0)

With Selection.Font
 .Name = "Arial"
 .Size = 20
 .Bold = True
 End With
End If
End Sub

Je vous remercie d'avance
 
Dernière édition:

phlaurent55

Nous a quittés en 2020
Repose en paix
Re : Formaté Textbox

Bonjour Max,

Code:
Private Sub TextBox5_Change()
If TextBox5 = "DCD" Then
TextBox5.ForeColor = RGB(255, 0, 0)
With TextBox5.Font
 .Name = "Arial"
 .Size = 20
 .Bold = True
 End With
End If
End Sub

à+
Philippe
 

Discussions similaires

Statistiques des forums

Discussions
314 207
Messages
2 107 261
Membres
109 790
dernier inscrit
hakim.kerbiche