OuiOuiNonNon
XLDnaute Nouveau
Bonjour, j'aimerais que le dernier caractère de mon commentaire soit en gras mais je ne sais pas comment faire. Merci d'avance
Sub Test()
If Not [C6].Comment Is Nothing Then [C6].Comment.Delete
[C6].AddComment
[C6].Comment.Visible = True
[C6].Comment.Text Text:="Exemple:" & Chr(10) & "Commentaire X en gras: X"
Call FormatCommentaireDernierCaractèresGras([C6])
End Sub
Sub FormatCommentaireDernierCaractèresGras(Cellule As Range)
Dim Lg As Integer
If Cellule.Comment Is Nothing Then Exit Sub
Lg = Len(Cellule.Comment.Text)
With Cellule.Comment.Shape.TextFrame
'.Characters.Font.Size = 11
'.Characters.Font.Color = RGB(255, 0, 0)
'.Characters(Start:=1, Length:=Lg).Font.Bold = False
.Characters(Start:=Lg, Length:=1).Font.Bold = True
End With
End Sub
Sub Test()
If Not [C6].Comment Is Nothing Then [C6].Comment.Delete
[C6].AddComment
[C6].Comment.Visible = True
[C6].Comment.Text Text:="Exemple:" & Chr(10) & "Commentaire X en gras: X"
Call FormatCommentaireDernierCaractèresGras([C6])
End Sub
Sub FormatCommentaireDernierCaractèresGras(Cellule As Range)
Dim Lg As Integer
If Cellule.Comment Is Nothing Then Exit Sub
Lg = Len(Cellule.Comment.Text)
With Cellule.Comment.Shape.TextFrame
'.Characters.Font.Size = 11
'.Characters.Font.Color = RGB(255, 0, 0)
'.Characters(Start:=1, Length:=Lg).Font.Bold = False
.Characters(Start:=Lg, Length:=1).Font.Bold = True
End With
End Sub